PaddlePaddle / Paddle2ONNX

ONNX Model Exporter for PaddlePaddle
Apache License 2.0
712 stars 165 forks source link

SMOKE模型转ONNX出错 #907

Open hitbuyi opened 1 year ago

hitbuyi commented 1 year ago

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

问题描述 SMOKE 模型转ONNX,转换失败

更多信息 :

报错截图

(pddl) hitbuyi@hitbuyi-Dell-G15-5511:~/PycharmProjects/padlepadle|_project/SMOKE/model2onnx$ paddle2onnx --model_dir ./ --model_filename smoke_kitti.pdmodel --params_filename smoke_kitti.pdiparams --save_file smoke_kitti.onnx --enable_dev_version True

[Paddle2ONNX] Start to parse PaddlePaddle model... [Paddle2ONNX] Model file path: ./smoke_kitti.pdmodel [Paddle2ONNX] Paramters file path: ./smoke_kitti.pdiparams [Paddle2ONNX] Start to parsing Paddle model... [Paddle2ONNX] Cannot find output:ind_0 in input tensors while converting operator 'while', Paddle2ONNX doesn't support this situation now. [Paddle2ONNX] Cannot find output:ind_0 in input tensors while converting operator 'while', Paddle2ONNX doesn't support this situation now. [Paddle2ONNX] Cannot find output:ind_0 in input tensors while converting operator 'while', Paddle2ONNX doesn't support this situation now. [Paddle2ONNX] Cannot find output:_generated_var_15 in input tensors while converting operator 'while', Paddle2ONNX doesn't support this situation now. [Paddle2ONNX] Oops, there are some operators not supported yet, including conditional_block,crop_tensor,select_input,while, [ERROR] Due to the unsupported operators, the conversion is aborted. Aborted (core dumped)

其他信息

yeliang2258 commented 1 year ago

请问你的模型来自?这个模型里面有控制流,目前Paddle2ONNX暂时不支持转换带有控制流的Paddle模型到ONNX

hitbuyi commented 1 year ago

控制流

请问一下, 1,什么是控制流?这个模型的控制流指哪些? 2,如果改写控制流?能否转? 3,如果改写不支持的算子,能否转? 谢谢。

yeliang2258 commented 1 year ago

比如你的模型中有if,for这样的语句,在动转静之后就会有控制流,如果可以将这样的组网改一下,就可以转为ONNX

yeliang2258 commented 1 year ago

另外,也可以尝试一下Paddleinference,里面可以很方便的调用TensorRT

hitbuyi commented 1 year ago

正在看Paddleinference,提供了C/C++库,不过几个G,有点大,有方法减少吗?

Zheng-Bicheng commented 2 months ago