Paddle ppyolov2导出onnx失败,

nkcskrwz  于 2021-11-30  发布在  Java
关注(0)|答案(2)|浏览(629)

你好,我在文档中看到ppyolov2在op 11下是支持导出为onnx模型,然后我按教程步骤操作但是导出失败了,提示有三个算子不支持,请问这个是怎么回事呢?
导出命令

paddle2onnx --model_dir /home/lw/Workspace/project_rc/inference_model/ppyolov2_r101vd_dcn_365e_coco \
            --model_filename model.pdmodel \
            --params_filename model.pdiparams \
            --opset_version 11 \
            --save_file yolov3.onnx

log

(paddle) lw@DellT4:~/Workspace/project_rc/inference_model/ppyolov2_r101vd_dcn_365e_coco$ paddle2onnx --model_dir /home/lw/Workspace/project_rc/inference_model/ppyolov2_r101vd_dcn_365e_coco             --model_filename model.pdmodel             --params_filename model.pdiparams             --opset_version 11             --save_file ppyolov3.onnx
Traceback (most recent call last):
  File "/home/lw/.local/bin/paddle2onnx", line 8, in <module>
    sys.exit(main())
  File "/home/lw/.local/lib/python3.6/site-packages/paddle2onnx/command.py", line 142, in main
    enable_onnx_checker=args.enable_onnx_checker)
  File "/home/lw/.local/lib/python3.6/site-packages/paddle2onnx/command.py", line 114, in program2onnx
    enable_onnx_checker=enable_onnx_checker)
  File "/home/lw/.local/lib/python3.6/site-packages/paddle2onnx/convert.py", line 77, in program2onnx
    export_onnx(paddle_graph, save_file, opset_version, enable_onnx_checker)
  File "/home/lw/.local/lib/python3.6/site-packages/paddle2onnx/convert.py", line 32, in export_onnx
    onnx_graph = ONNXGraph.build(paddle_graph, opset_version, verbose)
  File "/home/lw/.local/lib/python3.6/site-packages/paddle2onnx/graph/onnx_graph.py", line 229, in build
    onnx_graph.build_op_nodes(paddle_graph.node_map)
  File "/home/lw/.local/lib/python3.6/site-packages/paddle2onnx/graph/onnx_graph.py", line 183, in build_op_nodes
    OpMapper.check_support_status(node_map, self.opset_version)
  File "/home/lw/.local/lib/python3.6/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
=========== select_input ===========
=========== conditional_block ===========
=========== logical_not ===========
r9f1avp5

r9f1avp51#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

qybjjes1

qybjjes12#

@liwang54321 你好,在导出ppyolov2模型时,请注意使用PaddleDetection 2.1的release,在此前的PaddleDetection版本中,保存ppyolov2模型时会保存控制流分支,导致无法转成ONNX。

使用PaddleDetection2.1的release即可解决该问题,参考此文档https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.1/deploy/EXPORT_ONNX_MODEL.md

相关问题