ncnn-assets
ncnn-assets copied to clipboard
Converting yolov7-tiny from pytorch to ncnn
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?