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

Converting yolov7-tiny from pytorch to ncnn #14

Open
nahidalam opened this issue Oct 7, 2022 · 0 comments
Open

Converting yolov7-tiny from pytorch to ncnn #14

nahidalam opened this issue Oct 7, 2022 · 0 comments

Comments

@nahidalam
Copy link

I trained yolov7-tiny on a custom dataset, converted it to onnx using this example and then converted that onnx to ncnn using this.

pt to onnx conversion

python export.py --weights MY_MODEL.pt --simplify --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 416 416 --max-wh 416

onnx to ncnn conversion

onnx2ncnn MY_MODEL.onnx MY_MODEL.param MY_MODEL.bin

When I open up the MY_MODEL.param with netron, I see that the value of w parameter for the reshape layer of all the outputs is some positive integer (e.g. 676). And the detection does not work (does not show any of the class).

When I compared MY_MODEL.param with your yolov7-tiny.param , I see that the value of w parameter for the reshape layer of all the outputs is -1. If I manually change this value to -1 in my own MY_MODEL.param, my model works with proper detection.

Can you please explain how you created your yolov7-tiny ncnn? What are the exact steps you did?

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

1 participant