Hi, I am having trouble with a converted custom yolov5s.pt to ncnn:
I have trained a custom yolov5s.pt object detector with two classes, say my_yolov5s.pt. Then, I converted it to my_yolov5s.onnx using the yolov5/export.py:
python export.py --weights my_yolov5s.pt --include onnx --simplify
Later, I tried to convert the model into ncnn using onnx2ncnn.exe:onnx2ncnn.exe my_yolov5s.onnx my_yolov5s.param my_yolov5s.bin
Up to this point, everything went smoothly. However, while I am trying to inference using ncnn version of my model, it crashes at ex.extract("output0", out)
I am attaching the screenshot of the Exception message. I appreciate any help or suggestions.
2条答案
按热度按时间ztigrdn81#
ncnn is open source, you can debug with source code.
And if your model is trained by pytorch, please use pnnx to convert it to ncnn.
ldfqzlk82#
I tried pnnx as follows:
pnnx.exe my_yolov5s.pt inputshape=[1,3,640,640]
But I got the following messages:
**BTW:**I trained my model using the main repository of yolov5 ([https://github.com/ultralytics/yolov5])