DCNv2_latest icon indicating copy to clipboard operation
DCNv2_latest copied to clipboard

onnx model has no weights and bias

Open ArtyZe opened this issue 5 years ago • 6 comments

Hello, thanks for your great work! Now I can export onnx model with dcn op successfully. But my onnx model is not correct: image As my weights and bias have not been export to onnx.

Have you ever met same error? Thanks!

ArtyZe avatar Aug 06 '20 08:08 ArtyZe

@ArtyZe How did you manage to export to ONNX model? When I try to export to onnx, I get RuntimeError: No Op registered for Plugin with domain_version of 9 Thanks in advance for you help!

maxclaey avatar Oct 20 '20 12:10 maxclaey

@ArtyZe DCN's onnx is a custom op not listed on ONNX standard, your visualization result might not accurate. For validation, you can check your onnx inference result using onnx-runtime.

lucasjinreal avatar Oct 21 '20 06:10 lucasjinreal

@ArtyZe How did you manage to export to ONNX model? When I try to export to onnx, I get RuntimeError: No Op registered for Plugin with domain_version of 9 Thanks in advance for you help!

Hi, You got see code below in file dcnv2_onnx.py ? image It's a torch supported way to register ops to torch/onnx. So 1. replace your dcnv2.py file with dcnv2_onnx.py then export model to onnx or 2. add above code to your own code and then export model to onnx

ArtyZe avatar Oct 21 '20 06:10 ArtyZe

@ArtyZe DCN's onnx is a custom op not listed on ONNX standard, your visualization result might not accurate. For validation, you can check your onnx inference result using onnx-runtime.

You are right. It's a tool bug of netron for custom ops. Data exist but netron displays nothing. It's right when I export data of this op with python

ArtyZe avatar Oct 21 '20 07:10 ArtyZe

@maxclaey did you find a solution to this? I'm running into the same issue. @jinfagang Do you happen to know what this error comes from?

edit: Turns out I needed operator_export_type=torch.onnx.OperatorExportTypes.ONNX_ATEN_FALLBACK in torch.onnx.export()

austinmw avatar Feb 25 '21 16:02 austinmw

@ArtyZe I have tried your solution using dcnv2_onnx.py but I am still facing the same error RuntimeError: No Op registered for Plugin with domain_version of 9. Could you please share with me the file that you used to convert to onnx. Thanks.

MoaazAbdulrahman avatar Oct 20 '21 13:10 MoaazAbdulrahman