ncnn-android-yolov5
ncnn-android-yolov5 copied to clipboard
How to convert yolov5 to NCNN?
Hi nihui:
as I as know, there is some ops that NCNN doesn't support,so how do you convert it to NCNN,thanks very much.
refer https://zhuanlan.zhihu.com/p/275989233 (in chinese)
After I modified the param file, the following information appeared using ncnnoptimize. Does anyone know how to solve it?
layer YoloV5Focus not exists or registered 段错误 (核心已转储)
After I modified the param file, the following information appeared using ncnnoptimize. Does anyone know how to solve it?
layer YoloV5Focus not exists or registered 段错误 (核心已转储)
- Replace your custom layer YoloV5Focus with a known builtin layer, such as Exp
- Run ncnnoptimize
- Change Exp back to YoloV5Focus in the optimized param
refer https://zhuanlan.zhihu.com/p/275989233 (in chinese)
many thanks!
I change the param like this Input images 0 1 images Exp focus 1 1 images 207 Convolution Conv_41 1 1 207 208 0=32 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=3456
and run ./ncnnoptimize onnx/yolov5s.param onnx/yolov5s.bin yolov5s-opt.param yolov5s-opt.bin 65536 but failed,there is the information
Input layer images without shape info, shape_inference aborted
Anyone know how to solve it?
I have the same problem. The generated file cannot be used in the android project.
the same question
the same question for me. but the opt param and bin files are still generated. However, the detection performance is poor comparing to yolov5s.pt.
refer https://zhuanlan.zhihu.com/p/275989233 (in chinese)
我从pytorch hub上下载了yolov5s.pt,这个pt我测试了,工作正常。然后严格按照这篇文章的做法生成了param和bin文件,替换您的安卓项目中的相应文件,生成了apk,手机上可以正常安装,也能运行,但识别率跟原始的pt差距很大,也跟您安卓项目提供的param和bin文件差距很大,很多近处的人物都识别不出来。用文本编辑器打开您安卓项目中的param文件和我生成的param文件,比较发现,前面部分都一样,后面有一些差别。请问这是什么原因?需要您的帮助!
最新版本ncnn的ncnnoptimize已经支持自定义op了
Refer to this website (https://zhuanlan.zhihu.com/p/275989233) . Do I need to change the Focus to remove the slice array operation under common.py when generating the onnx model?
I change the param like this Input images 0 1 images Exp focus 1 1 images 207 Convolution Conv_41 1 1 207 208 0=32 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=3456
and run ./ncnnoptimize onnx/yolov5s.param onnx/yolov5s.bin yolov5s-opt.param yolov5s-opt.bin 65536 but failed,there is the information
Input layer images without shape info, shape_inference aborted
Anyone know how to solve it?
@yao-zheng-yi Did you sovle it ? I have a same problem, how to fix it ?
I change the param like this Input images 0 1 images Exp focus 1 1 images 207 Convolution Conv_41 1 1 207 208 0=32 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=3456
and run ./ncnnoptimize onnx/yolov5s.param onnx/yolov5s.bin yolov5s-opt.param yolov5s-opt.bin 65536 but failed,there is the information
Input layer images without shape info, shape_inference aborted
Anyone know how to solve it?
Do you sovle it? I also have the same problem, how to fix? Many thx!