自己记录一下(根据炮哥博文)
首先下载GitHub源码,选到5.0版本,然后conda创建一个虚拟环境,因为这次没用到GPU,所以环境配置较为简单,在创建好的环境直接
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
在pip中出了些问题:Pycocotools安装失败,感觉并不需要安装此包
直接注释掉
开始进行代码调试:
在pycharm中选择自己创建的环境
以下为遇到的问题
1、
opencv-python>=4.1.2 not found and is required by YOLOv5
针对这个问题,网上的教程有很多,但都没有得到解决,重新卸载再安装opencv-python一样还是不行。
最后发现是自己的python版本选择错了,YOLOv5只支持python3.8及以下版本,我用的python3.9,所以又重新配置环境。
2、Exception:Dataset not found.
考虑是图片路径的问题:
改为
3、AttributeError: module 'numpy' has no attribute 'int'
解决:在<datasets>和<general>中,将 np.int 改为 int
4、RuntimeErroe:
注意:TypeError:
torch地址