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

Wrong result for onnx-ncnn yolov5s_6.0 #3600

Open
Draft00 opened this issue Mar 7, 2022 · 8 comments
Open

Wrong result for onnx-ncnn yolov5s_6.0 #3600

Draft00 opened this issue Mar 7, 2022 · 8 comments

Comments

@Draft00
Copy link

Draft00 commented Mar 7, 2022

Problem: incorrect detection

Windows platform. Image with wrong detection for example: image

model | 模型 | モデル

  1. original model: https://github.com/ultralytics/yolov5

how to reproduce | 复现步骤 | 再現方法

  1. Install yolov5 steps from Quick Start Examples.
  2. Verify: python detect.py --source data/images --weights yolov5s.pt --conf 0.25.
  3. Export for solve problems 'Unsupported slice step !': python export.py --include onnx --weight yolov5s.pt --img 640 --train --simplify. According to this.
  4. Conversion using out-of-the-box web model conversion (https://convertmodel.com/#outputFormat=ncnn): check both 'Optimize', check 'Generate ft16 model'.
  5. Comparing my .param file with the param file example (https://github.com/nihui/ncnn-assets/blob/master/models/yolov5s_6.0.param). The layers are the same, only the numbers differ. Size the .bin file is the same as in the example
  6. Use ncnn tutorial (https://github.com/Tencent/ncnn/blob/master/examples/yolov5.cpp) for yolov5s_6.0. Rewrite ex.extract() according to my .param file numbers.
  7. ...And I get a completely incorrect detection result :(

@zhiliu6, could you tell me how you converted the model? it seemed to me that I was doing similar steps, but this is not the case :(

@xbc922
Copy link

xbc922 commented Mar 26, 2022

I have similar problems,run on android,params yololv5 6.0 by pnnx

traffic_model.zip

@lizozom
Copy link

lizozom commented May 26, 2022

Running into a similar issue. Have you had any luck resolving this @xbc922 @Draft00 @zhiliu6?

@Draft00
Copy link
Author

Draft00 commented May 26, 2022

Running into a similar issue. Have you had any luck resolving this @xbc922 @Draft00 @zhiliu6?

@lizozom, Nope :(. I had to use yolov4.

@lizozom
Copy link

lizozom commented May 29, 2022

@Draft00 my intuition tells me that the processing of images is different between the python and JavaScript versions.
I'm not an ML pro, so I'm having a hard time analysing this myself.

@houshoubao
Copy link

I have the same issue with yolov5n.

@lizozom
Copy link

lizozom commented Sep 5, 2022

cc I ended up using an older version as well.

@nqthai309
Copy link

nqthai309 commented Sep 16, 2022

the same error, can you solve it ?

@nihui
Copy link
Member

nihui commented Aug 5, 2024

针对onnx模型转换的各种问题,推荐使用最新的pnnx工具转换到ncnn
In view of various problems in onnx model conversion, it is recommended to use the latest pnnx tool to convert your model to ncnn

pip install pnnx
pnnx model.onnx inputshape=[1,3,224,224]

详细参考文档
Detailed reference documentation
https://github.com/pnnx/pnnx
https://github.com/Tencent/ncnn/wiki/use-ncnn-with-pytorch-or-onnx#how-to-use-pnnx

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

No branches or pull requests

6 participants