PaddlePaddle / Paddle2ONNX

ONNX Model Exporter for PaddlePaddle
Apache License 2.0
738 stars 173 forks source link

There's 3 ops are not supported yet #135

Closed vijayky88 closed 6 months ago

vijayky88 commented 4 years ago

hi,

i am using ch_ppocr_mobile_v1.1_rec_train.tar model and exported to fluid model and wanted to convert to onnx model. but failes with below error:

paddle.version = 1.8.5 Now, paddle2onnx support convert paddle model to onnx opset_verison [9, 10, 11], opset_verison be seted as 9, automatically treated as opset_version: 9. Translating PaddlePaddle to ONNX...

Total:198, Current:1 : feed image Total:198, Current:176 : im2sequence add

"==========Importance Notice=========== Since im2sequence operator is used in your paddlepaddle model, the translated onnx model only support input data with batch_size=1. ======================================"

Total:198, Current:198 : fetch x n e_add There's 3 ops are not supported yet =========== ctc_align =========== =========== top_k =========== =========== lstm ===========

please let me know if i need to do any woraround.

Thanks Vijay skypeid: vijayky88

SWHL commented 4 years ago

I have met the same question.

vijayky88 commented 4 years ago

@SWHL any alternative available ?

Channingss commented 4 years ago

Now, there is a big difference between Paddle::lstm and ONNX:LSTM. We are upgrading the interface of LSTM, At the end of the year we will try to add the conversion of lstm.

SWHL commented 4 years ago

@vijayky88 The LSTM op of the PyTorch can convert to the onnx. Trouble Converting LSTM Pytorch Model to ONNX

vijayky88 commented 4 years ago

This is good news if we will be able to export this model to onnx by the end of this year! Thanks

On Tue, Oct 27, 2020 at 7:53 PM SWHL notifications@github.com wrote:

@vijayky88 https://github.com/vijayky88 The LSTM op of the PyTorch can convert to the onnx. Trouble Converting LSTM Pytorch Model to ONNX https://stackoverflow.com/questions/57299674/trouble-converting-lstm-pytorch-model-to-onnx

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PaddlePaddle/paddle2onnx/issues/135#issuecomment-717279761, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAL4TT3RSQ4TBMECR4OLBDSM3JXPANCNFSM4S5SHUPQ .

DayDayupupupup commented 3 years ago

I have met the same question with opset 13. Has the problem been solved?

jiangjiajun commented 3 years ago

I have met the same question with opset 13. Has the problem been solved?

PaddleOCR model is supported now, the problem you met is Paddle2ONNX cannot convert PaddleOCR model to onnx with opset 13?

kano201 commented 3 years ago

我在转换自己使用PaddleOCR训练的识别模型时也会出现相同的问题

paddle2onnx --model_dir ./pretrained_models/crnn --model_filename model --params_filename params --save_file convert_model --opset_version 10 --enable_onnx_checker True

Traceback (most recent call last): File "d:\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\Anaconda3\Scripts\paddle2onnx.exe__main__.py", line 7, in File "d:\anaconda3\lib\site-packages\paddle2onnx\command.py", line 142, in main enable_onnx_checker=args.enable_onnx_checker) File "d:\anaconda3\lib\site-packages\paddle2onnx\command.py", line 114, in program2onnx enable_onnx_checker=enable_onnx_checker) File "d:\anaconda3\lib\site-packages\paddle2onnx\convert.py", line 77, in program2onnx export_onnx(paddle_graph, save_file, opset_version, enable_onnx_checker) File "d:\anaconda3\lib\site-packages\paddle2onnx\convert.py", line 32, in export_onnx onnx_graph = ONNXGraph.build(paddle_graph, opset_version, verbose) File "d:\anaconda3\lib\site-packages\paddle2onnx\graph\onnx_graph.py", line 229, in build onnx_graph.build_op_nodes(paddle_graph.node_map) File "d:\anaconda3\lib\site-packages\paddle2onnx\graph\onnx_graph.py", line 183, in build_op_nodes OpMapper.check_support_status(node_map, self.opset_version) File "d:\anaconda3\lib\site-packages\paddle2onnx\op_mapper\op_mapper.py", line 144, in check_support_status raise NotImplementedError(error_info) NotImplementedError: There's 3 ops are not supported yet =========== lstm =========== =========== top_k =========== =========== ctc_align ===========

SWHL commented 3 years ago
jiangjiajun commented 3 years ago

@kano201 看起来你的模型是之前版本的OCR模型,在PaddleOCR最新代码中的模型可以支持转成ONNX

DayDayupupupup commented 3 years ago

Thanks,I switched to PaddleOCR2, which converted to onnx successfully。

754467737 commented 3 years ago

pp-tsm模型推理,paddle转onnx, There's 1 ops are not supported yet =========== temporal_shift =========== temporal_shift也不支持,怎么办?