-
Notifications
You must be signed in to change notification settings - Fork 434
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
Using TransposeOptimizer breaks model #1809
Comments
Could you please share the related code which will cause such issue so we can do a local repro for a further investigation? |
Sure, so I put the initial and broken models in a zip file which you can download from here(link removed). I modified the optimize script initially just to narrow down the problem to the transpose optimizer, but for reproduction purposes I use the original script this way : To test a model, I use ONNXRuntime with the following script with any image of width 500 by height 224. Just replace the model filename to the broken one to get the error :
If this is not enough, let me know! |
If we comment the _split_handler optimizer code, the optimizer will run successfully. |
Hi @CarlPoirier |
Hi @hwangdeyu, Nice! I'm looking forward to the next release. Thanks for the time you spent onto this. |
TF2ONNX 1.10.1 has been released. ☺ |
Hi @hwangdeyu, It does work now for the models I had linked earlier using tf2onnx 1.10.1, but it seems there are still some issues with some other models. I opened a new issue, #1941 . |
Describe the bug
I have an onnx model on which I want to run the onnx-optimize.py script. All the optimizers work fine except the TransposeOptimizer. When I use it, my onnx model is not working anymore, with onnxruntime at least. I get this error :
[E:onnxruntime:, sequential_executor.cc:346 onnxruntime::SequentialExecutor::Execute] Non-zero status code returned while running Split node. Name:'Split_1297' Status Message: Cannot split using values in 'split' attribute. Axis=1 Input shape={1,1710} NumOutputs=1 Num entries in 'split' (must equal number of outputs) was 1 Sum of sizes in 'split' (must equal size of selected axis) was 1
Urgency
None, for now I deactivated this optimizer and I'm using all the others.
System information
To Reproduce
So I modified the onnx-optimize.py script to specify only the TransposeOptimizer. Then, I'm running it this way:
python onnx-optimize.py --input testmodel6.onnx --output testmodel6_broken.onnx 2021-12-22 21:27:52.255558: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cudart64_110.dll 2021-12-22 21:27:58,174 - INFO - Optimizing ONNX model 2021-12-22 21:27:59,100 - INFO - After optimization: Transpose -4 (15->11)
If you need any more information, let me know!
The text was updated successfully, but these errors were encountered: