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

使用paddle2onnx转换mot_ppyoloe_l_36e_pipeline模型到onnx格式,使用onnxruntime加载转换后的onnx模型文件报错。 #1375

Open
leashi opened this issue Sep 5, 2024 · 6 comments
Labels
Bug Something isn't working

Comments

@leashi
Copy link

leashi commented Sep 5, 2024

使用paddle2onnx转换mot_ppyoloe_l_36e_pipeline模型到onnx格式,使用onnxruntime加载转换后的onnx模型文件报错。

环境:
ubuntu-22.04
paddle2onnx-1.2.8
PaddlePaddle 2.6.1
onnxruntime-1.19.2

模型文件地址:
https://bj.bcebos.com/v1/paddledet/models/pipeline/mot_ppyoloe_l_36e_pipeline.zip

转换命令:
paddle2onnx --model_dir ./person/mot_ppyoloe_l_36e_pipeline
--model_filename model.pdmodel
--params_filename model.pdiparams
--save_file ./person/mot_ppyoloe_l_36e_pipeline/model.onnx
--enable_onnx_checker True

转换命令的输出:
[Paddle2ONNX] Start to parse PaddlePaddle model...
[Paddle2ONNX] Model file path: ./person/mot_ppyoloe_l_36e_pipeline/model.pdmodel
[Paddle2ONNX] Parameters file path: ./person/mot_ppyoloe_l_36e_pipeline/model.pdiparams
[Paddle2ONNX] Start to parsing Paddle model...
[Paddle2ONNX] Oops, there are some operators not supported yet, including
[Paddle2ONNX] [reduce_mean: mean_0.tmp_0] Requires the minimal opset version of 11.
[Paddle2ONNX] [reduce_mean: mean_1.tmp_0] Requires the minimal opset version of 11.
[Paddle2ONNX] [reduce_mean: mean_2.tmp_0] Requires the minimal opset version of 11.
[Paddle2ONNX] [reduce_mean: mean_3.tmp_0] Requires the minimal opset version of 11.
[Paddle2ONNX] [nearest_interp_v2: nearest_interp_v2_0.tmp_0] Requires the minimal opset version of 11.
[Paddle2ONNX] [nearest_interp_v2: nearest_interp_v2_1.tmp_0] Requires the minimal opset version of 11.
[Paddle2ONNX] [multiclass_nms3: multiclass_nms3_0.tmp_1] Requires the minimal opset version of 10.
[Paddle2ONNX] Due to the operator: reduce_mean, requires opset_version >= 11.
[Paddle2ONNX] Opset version will change to 11 from 9
[Paddle2ONNX] Use opset_version = 11 for ONNX export.
[WARN][Paddle2ONNX] [multiclass_nms3: multiclass_nms3_0.tmp_1] [WARNING] Due to the operator multiclass_nms3, the exported ONNX model will only supports inference with input batch_size == 1.
[Paddle2ONNX] PaddlePaddle model is exported as ONNX format now.

跟踪到onnxruntime源码内部,为加载模型文件失败,错误信息:
"Node (p2o.Gather.8) Op (Gather) [ShapeInferenceError] data tensor must have rank >= 1"

@188080501
Copy link

同遇到这个问题,PP-YOLOE_plus-L和YOLOXL都是这样

Copy link

github-actions bot commented Dec 7, 2024

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 7, 2024
@swithmn1
Copy link

同问,PP-YOLOE_plus-X导出来是这个问题

@github-actions github-actions bot removed the stale label Dec 14, 2024
@swithmn1
Copy link

image
把这部分拿出来实现就可以了,我试了没问题的

@WindLWQ
Copy link

WindLWQ commented Dec 27, 2024

image 把这部分拿出来实现就可以了,我试了没问题的

请问这部分在哪个位置呢?遇到同一个问题了

@swithmn1
Copy link

swithmn1 commented Jan 7, 2025

@WindLWQ 设置exclude_nms=True ,这部分自己在后处处理实现,不要放在onnx里
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants