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

paddleseg模型和onnx模型的推理结果不一致,精度差距较大 #3682

Open
1 task done
LS1030 opened this issue Mar 28, 2024 · 2 comments
Open
1 task done
Assignees
Labels
question Further information is requested

Comments

@LS1030
Copy link

LS1030 commented Mar 28, 2024

问题确认 Search before asking

  • 我已经搜索过问题,但是没有找到解答。I have searched the question and found no related answer.

请提出你的问题 Please ask your question

问题描述

发现paddleseg模型和使用paddle2onnx转换出来的onnx模型的推理结果不一致,精度差距较大。

不知道是因为什么原因导致的。

测试环境

飞桨版本

paddle2onnx              1.1.0
paddlepaddle-gpu         2.5.1.post120
paddleseg                2.9.0    

问题复现

通过脚本计算paddleseg模型和onnx模型的miou不一致,使用同样的数据集测试的结果为:

paddle miou为95.10%,onnx miou为89.13%,精度差距较大

模型的目标是将地面与其他物体分割开,只分割两类,标签0为背景,标签1为背景。

通过查看推理的图片发现推理结果与miou表现一致,精度差距较大。
推理结果对比
左边为原图,中间为paddleseg模型的推理结果,右边为onnx模型的推理结果。

具体的复现工程可以查看:https://github.com/LS1030/paddle_onnx_test.git

@LS1030 LS1030 added the question Further information is requested label Mar 28, 2024
@wangkd0
Copy link

wangkd0 commented Apr 3, 2024

这个怎么处理,和导出时设置参数有关吗,另外导出时必须指定input_shape吗。不指定导出会报错

@shiyutang
Copy link
Collaborator

你好,和指定inputshape 没有关系,这说明paddle2onnx或者onnxruntime存在精度误差,请前往paddle官网提问或者切换其他后端。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants