-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,onnx提供的fasterrcnn简化失败,你能解决一下吗? #14
Comments
Could you please provide the error message? |
|
Seems dynamic input not supported by onnxruntime. |
But actually, onnxruntime can inference model with dynamicly correct |
@jinfagang i think your source code is not correct,please post it. |
It's not about source code. I simply convert maskrcnn.onnx from onnx model zoo. You can try simplifying it. But challenging. Currently, this model generated with too much complicated node structure, the reason for simpliying is that I want convert it to TensorRT, it's can't be done if not do some model surgeon on it. |
I am able to make it forward by sending numpy.array with certain dimension converted from my input image. For onnx-sim it doesn't handle dynamic input which always get (3,0,0) input size. I caught some weired Constant op:
Which seems can not be simplified either can not leave it alone. I can using onnx-sim forward now but can't remove all Constant layers. When eliminating these nodes will caught error:
They have no elem_type from above structure. |
@jinfagang You are right, onnxsim cannot handle dynamic input shape currently, I'll try to support it when I have time |
@daquexian May I ask that from your codes I only saw constant simplifying (clean Const and Eliminate Const) which basically is convert constants with Tensors raw data into a combined Const node. How do u able to simplifying these (shape->gather->unsqueeze) into a single reshape node? Correct me if am wrong. |
@jinfagang great question. As long as the input shape is determined, the output of shape, gather and unsqueeze op will be all marked as const in onnxsim and be replaced by constant ops. |
I see.. so that dynamic inputs graph such as maskrcnn will impossible to simplify in this way... because every middle output shape will be various on different images or same image but different input size. |
Sorry for the late reply. It depends. The ops performed on const data (e.g., weights and bias) will be also eliminated via simplifying, no matter whether the input shape is static.
Could you provide the error log for the failure case? It is helpful to find the reason. |
Some large model can not be or hard to simplify such as maskrcnn.onnx |
Could you please open a separate issue for it? Thanks! This issue is closing since onnxsim now supports setting input shape manually in v0.1.9 |
|
https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/faster-rcnn,这是onnx提供的模型,你可以用这个复现,谢谢。
The text was updated successfully, but these errors were encountered: