如果说目标检测落地最广的是哪个算法,yolo系列肯定有一席之地,本文为大家介绍yolov5s 4.0模型如何转换为caffe模型并推理,据我所知,华为海思NNIE只支持caffe模型的转换,所以yolov5模型要想在海思芯片上部署,转换为caffe模型是有必要的(在我的1070显卡上,yolov5s 4.0 的模型inference做到了11ms一帧!)
推理速度截图
libstdc++.so.6: version `GLIBCXX_3.4.21' not found
解决方案:https://blog.csdn.net/phdsky/article/details/84104769?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.add_param_isCf&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.add_param_isCf#commentBox
ImportError: No module named google.protobuf.internal
解决方案:https://blog.csdn.net/quantum7/article/details/83507364
wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or dir
解决方案:https://blog.csdn.net/weixin_37251044/article/details/79158823
如果有小伙伴,想把caffe模型部署到海思芯片,建议把yolov5的focus层替换为conv层(stride为2),upsample层替换为deconv层,如下图所示修改:
修改后的模型配置yaml文件
预测效果展示
本文仅做学术分享,如有侵权,请联系删文。