Skip to content
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

[BUG] Shape not supported yet! Tile not supported yet! #323

Open
minushuang opened this issue Feb 28, 2024 · 1 comment
Open

[BUG] Shape not supported yet! Tile not supported yet! #323

minushuang opened this issue Feb 28, 2024 · 1 comment

Comments

@minushuang
Copy link

minushuang commented Feb 28, 2024

Describe the bug
I trained an ocr model with paddlepaddle-2.6, and export the model to onnx, then I convert the original onnx model to ncnn, it reported error:

Shape not supported yet!
Tile not supported yet!
Shape not supported yet!
Tile not supported yet!

so, i try to use the python3 -m onnx2sim src.onnx sim.onnx to simplifier the onnx model, and it shows as below,

Your model contains "Tile" ops or/and "ConstantOfShape" ops. Folding these ops can make the simplified model much larger. If it is not expected, please specify "--no-large-tensor"(which will lose some optimization chances)

Finish! Here is the difference:
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃                    ┃ Original Model ┃ Simplified Model ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
│ Add                │ 26             │ 26               │
│ BatchNormalization │ 35             │ 0                │
│ Clip               │ 18             │ 18               │
│ Concat             │ 20             │ 1                │
│ Constant           │ 397            │ 124              │
│ Conv               │ 53             │ 53               │
│ Div                │ 18             │ 18               │
│ GlobalAveragePool  │ 9              │ 9                │
│ HardSigmoid        │ 9              │ 9                │
│ LSTM               │ 2              │ 2                │
│ MatMul             │ 1              │ 1                │
│ MaxPool            │ 1              │ 1                │
│ Mul                │ 27             │ 27               │
│ Relu               │ 15             │ 15               │
│ Reshape            │ 2              │ 2                │
│ Shape              │ 2              │ 1                │
│ Slice              │ 30             │ 3                │
│ Softmax            │ 1              │ 1                │
│ Squeeze            │ 1              │ 1                │
│ Tile               │ 2              │ 1                │
│ Transpose          │ 7              │ 6                │
│ Model Size         │ 1.8MiB         │ 1.7MiB           │
└────────────────────┴────────────────┴──────────────────┘

the table show that the shape ops from 2 to 1, the tile ops from 2 to 1, not we expect the 0.
and the convert error is not eliminated when convert the simplified onnx model to ncnn with onnx2ncnn tool.

Model
https://drive.google.com/file/d/1ixsUIE3rwwUzmldavvZHr5TxtmBKg94r/view?usp=sharing

@minushuang
Copy link
Author

the input is dynamic with dynamic_batch x 3 x 32 x dynamic

@minushuang minushuang changed the title [BUG] Shape not supported yet! Gather not supported yet! [BUG] Shape not supported yet! Tile not supported yet! Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant