PaddlePaddle / Paddle2ONNX

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

PP-structure to onnx eror #802

Open NBd-hub opened 2 years ago

NBd-hub commented 2 years ago

请将下面信息填写完整,便于我们快速解决问题,谢谢!

问题描述 使用版面分析模型转化onnx模型报错 命令行:paddle2onnx --model_dir /root/.paddledet/inference_model/ppyolov2_r50vd_dcn_365e_publaynet/ppyolov2_r50vd_dcn_365e_publaynet_infer --model_filename inference.pdmodel --params_filename inference.pdiparams --save_file /home/paddle_new/PaddleOCR-release-2.5/ppstructure/model.onnx --opset_version 12

更多信息 :

报错截图 Traceback (most recent call last): File "/usr/local/python3.7.0/bin/paddle2onnx", line 8, in sys.exit(main()) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/command.py", line 224, in main auto_update_opset=args.enable_auto_update_opset) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/command.py", line 148, in program2onnx auto_update_opset) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/legacy/command.py", line 210, in program2onnx output_names=output_names) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/convert.py", line 80, in program2onnx operator_export_type, auto_update_opset, **configs) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/legacy/convert.py", line 102, in program2onnx output_names=output_names) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/legacy/convert.py", line 37, in export_onnx auto_update_opset) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/legacy/graph/onnx_graph.py", line 327, in build auto_update_opset=auto_update_opset) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/legacy/graph/onnx_graph.py", line 85, in init self.update_opset_version() File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/legacy/graph/onnx_graph.py", line 203, in update_opset_version node_map, self.opset_version) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/legacy/op_mapper/op_mapper.py", line 142, in get_recommend_opset_version node_map, opset_version, True) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle2onnx/legacy/op_mapper/op_mapper.py", line 188, in check_support_status raise NotImplementedError(error_info) NotImplementedError: There's 2 ops are not supported yet =========== conditional_block =========== =========== select_input ===========

其他信息

yeliang2258 commented 2 years ago

您好,请问你导出到ONNX模型的原因是?另外从导出命令来看,你是需要在OCR里面用目标检测模型吗?如果是目标检测模型,建议使用picodet或ppyoloe

NBd-hub commented 2 years ago

您好,我是想用pp-structure中的版面分析模型,并且这个版面分析模型的话似乎只有这个,转成onnx模型是因为想从onnx模型再去转成别的模型,此外我刚发现我的docker容器中的cmake版本为3.16 而paddle2onnx的环境的cmake版本要3.18,不知道是不是这个问题

yeliang2258 commented 2 years ago

不是Paddle2ONNX安装编译的问题,是因为这个模型中有不支持的结构导致导出报错,我已经反馈给OCR,有进展会及时同步给你

yeliang2258 commented 2 years ago

另外请问一下,转到其他模型是指转到某推理引擎下进行部署吗?如果是用TensorRT这样的部署工具,可以试试PaddleInference

NBd-hub commented 2 years ago

不是Paddle2ONNX安装编译的问题,是因为这个模型中有不支持的结构导致导出报错,我已经反馈给OCR,有进展会及时同步给你

好的,感谢解答,还想请问一下pp-structure版面分析模型能转成什么样的框架模型

NBd-hub commented 2 years ago

另外请问一下,转到其他模型是指转到某推理引擎下进行部署吗?如果是用TensorRT这样的部署工具,可以试试PaddleInference

是想onnx模型再转成om模型

NBd-hub commented 2 years ago

不是Paddle2ONNX安装编译的问题,是因为这个模型中有不支持的结构导致导出报错,我已经反馈给OCR,有进展会及时同步给你

另外能不能加个微信大佬!!要是可以的话可以微信号发我邮箱,拜托了!!!

an1018 commented 2 years ago

目前正在基于PicoDet优化版面分析的精度和速度,后面会发布模型~,也可以先基于ppyolov2和教程训练一版,再导出onnx的

NBd-hub commented 2 years ago

目前正在基于PicoDet优化版面分析的精度和速度,后面会发布模型~,也可以先基于ppyolov2和教程训练一版,再导出onnx的

我看了一下那个版面分析训练模型的教程,发现里面的配置文件中的主干网络已经变成了YOlOv3了,是不是推理模型和训练模型的网络结构不一样才导致的?

nissansz commented 1 year ago

版面分析模型转onnx成功了吗?怎么转换?

summerliubf commented 1 year ago

不是Paddle2ONNX安装编译的问题,是因为这个模型中有不支持的结构导致导出报错,我已经反馈给OCR,有进展会及时同步给你

您好,问一下现在这个模型可以支持导出ONNX了吗? 现在导出时出现如下错误: [Paddle2ONNX] Oops, there are some operators not supported yet, including conditional_block,deformable_conv,matrix_nms,select_input, [ERROR] Due to the unsupported operators, the conversion is aborted.

Zheng-Bicheng commented 4 months ago