前置编译器
首先地配置C++环境
使用目标检测 YOLOv5 开源代码项目调试与讲解实战【土堆 x 布尔艺数】_哔哩哔哩_bilibili
可以看这个视频的P2解决,但仅仅是这样还不够
各种报错
pip install pycocotools
报错 :error: command 'cl.exe' failed with exit code 1
ERROR: Failed building wheel for pycocotools
Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly
使用git安装
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
报错 Command errored out with exit status 128: git clone -q https://github.com/philferriere/cocoapi.git 'C:\Users\admin\AppData\Local\Temp\pip-req-build-_q9j7yxt' Check the logs for full command output.
另一种分开的方式也没用,cocotools下载下来了,但似乎装不到虚拟环境里,尝试了几个小时,太菜了,选择放弃。
以上问题似乎是网络墙和系统共同导致的问题(没仔细研究过,也可能不是),很难解决。
安装pycocotools-win,会发现这个已经很久没维护了,版本跟不上,依然报错。
解决方法
建议直接暴力安装 ,进入cocotools官网下载pycocotools · PyPI需要的版本包,一般是要大于2.0的
下载后解压,直接将这两个标黑的文件复制粘贴
粘贴在如下路径,虚拟环境在Anaconda3的envs底下,yolov5是我自己命名的。
奈斯,成功了
感谢提供解决方法的大佬
http://t.csdn.cn/ECtNjhttp://t.csdn.cn/ECtNj