Open nqthai309 opened 2 years ago
My command:
python export.py --include onnx --weight path/to/x.pt --img 640 --train --simplify
Have you simplified it?
I do it in this order, help me !!
yolov5m6.pt ---> onnx simplify
onnx ----> ncnn
run ncnn model
Have you tried yolov5m/s/n or online conversion ?
Have you tried yolov5m/s/n or online conversion ?
I try convert online
download model then optimize file param and bin
build and run yolov5 ncnn
Segmentation fault :(
I encountered the same problem and tried many times without solving it。
i test with ncnn model yolov5 v60 pre-training and it works fine, but when i manually convert pre-training model yolov5m6.pt -> onnx -> ncnn get error like this. Can someone help me.
=> convert onnx -> ncnn
=> inference ncnn model
If you solve it, please tell me your solution.
python export.py --weights ./yolov5m.pt --include torchscript onnx --train add "--train"
Hi @nihui , Can you please advise on this issue. Thanks.
"python export.py --include onnx --weight path/to/x.pt --img 640 --train --simplify" resolved my error during ncnn conversion.
i try convert pretrained model yolov5m6.pt -> onnx with
"python3 export.py --include onnx --weights yolov5m6.pt --train --simplify"
then convert onnx model -> ncnn model, but when i load them i get this error
"python export.py --include onnx --weight path/to/x.pt --img 640 --train --simplify" resolved my error during ncnn conversion.
You need to change the extract layers in the c++ file. Layers of the current model is mentioned in the error message under “Try”.
The example script is for yolov5s6 model. I tried with yolov5m6 model and didn’t get good results as you can see that there are 4 output layers. Hi @nihui can you please advise what changes are required for yolov5m6 model? Thanks
针对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
i test with ncnn model yolov5 v60 pre-training and it works fine, but when i manually convert pre-training model yolov5m6.pt -> onnx -> ncnn get error like this. Can someone help me.
=> convert onnx -> ncnn![image](https://user-images.githubusercontent.com/61822545/147488762-1564b5fd-70ab-4047-b600-f2e0ea6abbce.png)
=> inference ncnn model![image](https://user-images.githubusercontent.com/61822545/147488734-56406507-c3bd-4d35-ad76-e16a37a377cb.png)