Skip to content

Using TransposeOptimizer breaks model #1809

Closed
@CarlPoirier

Description

@CarlPoirier

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

  • OS Platform and Distribution: Windows 10
  • Tf2onnx version: 1.9.3
  • Tensorflow Version: 2.5.2
  • Python version: 3.9.9

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!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions