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

Cannot remove shape of ch_PP-OCRv4_rec #314

Open
stereomatchingkiss opened this issue Oct 26, 2023 · 0 comments
Open

Cannot remove shape of ch_PP-OCRv4_rec #314

stereomatchingkiss opened this issue Oct 26, 2023 · 0 comments

Comments

@stereomatchingkiss
Copy link

Describe the bug

paddle2onnx : 1.0.6
onnxsim : 0.4.35

Steps:

  1. Convert paddle model to onnx by paddle2onnx

paddle2onnx --model_dir ./ch/ch_PP-OCRv4_rec_infer ^
--model_filename inference.pdmodel ^
--params_filename inference.pdiparams ^
--save_file ./ch/rec_onnx/model.onnx ^
--opset_version 11 ^
--input_shape_dict="{'x':[-1,3,-1,-1]}" ^
--enable_onnx_checker True

  1. Simplify model.onnx by onnxsim

python -m onnxsim model.onnx out_simple.onnx

The output still exist layers

Reshape | 6 | 6
Shape | 4 | 3

  1. Convert out_simple.onnx to ncnn model

onnx2ncnn.exe ch_PP-OCRv4_rec_simple.onnx out.param out.bin

Error messages:

Shape not supported yet!
Unknown data type 0
Shape not supported yet!
Cast not supported yet!

to=6

Cast not supported yet!

to=7

Unknown data type 0
Unsupported transpose type !
Unsupported squeeze axes !
Unsupported squeeze axes !
Unsupported squeeze axes !
Unknown data type 0
Shape not supported yet!
Cast not supported yet!

to=6

Cast not supported yet!

to=7

Unknown data type 0
Unsupported transpose type !
Unsupported squeeze axes !
Unsupported squeeze axes !
Unsupported squeeze axes !
Unknown data type 0

Model
Model link, link of the document.

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