Win10下YOLOv5安装与测试-踩坑记

2 篇文章 0 订阅

环境:Win10+python3.7.5
最近在搭建YOLOv5的测试环境,期间也有不少错误信息,现将整个安装过程整理如下:
一、下载YOLOv5工程目录
YOLOv5项目下载
YOLOv5模型下载
二、安装所需的依赖库
坑1:报错“ERROR: Failed building wheel for pycocotools ”
执行如下命令安装依赖库:

pip --default-timeout=1000 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt 

报错如下:
在这里插入图片描述
解决方案如下
进入工程目录,打开requirements.txt做如下修改:将
Line13 修改如下:
git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI
替换为
git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
这行命令主要是为了下载安装pycocotools参考链接
在这里插入图片描述
再次运行命令,完美解决
在这里插入图片描述
表示安装成功。
坑2:报错:
“ error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed”
报错信息借用Ubuntu下的截图:
在这里插入图片描述
解决方法
执行命令:

git config --global http.postBuffer 524288000
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999

增加git 缓存,增加最低速度时间,再次执行,问题解决。
三、测试:
cd到YOLOv5所在的工程目录,执行命令:

python detect.py --source ./inference/images/bus.jpg --weights ./yolov5_models/yolov5s.pt --conf 0.4

详细的可参考官网给出的解释:

python detect.py --source file.jpg  # image 
                          file.mp4  # video
                          ./dir  # directory
                          0  # webcam
                          rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa  # rtsp stream
                          http://112.50.243.8/PLTV/88888888/224/3221225900/1.m3u8  # http stream

–source后面表示加载的源文件,可以是图片,视频等
–weights后面表示模型文件,需要的可留言
本来以为可以顺利运行出来检测结果,结果又报错如下:
坑3

Traceback (most recent call last): File “detect.py”, line 3, in from utils.datasets import * File “C:\Users\xx\PycharmProjects\yolov5-master\utils\datasets.py”, line 17, in from utils.utils import xyxy2xywh, xywh2xyxy File “C:\Users\xx\PycharmProjects\yolov5-master\utils\utils.py”, line 19, in from scipy.signal import butter, filtfilt File “C:\Users\xx\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy_init_.py”, line 104, in from . import distributor_init File “C:\Users\xx\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy_distributor_init.py”, line 61, in WinDLL(os.path.abspath(filename)) File "C:\Users\xx\AppData\Local\Programs\Python\Python37\lib\ctypes_init.py", line 364, in init self._handle = _dlopen(self._name, mode) OSError: [WinError 126] 找不到指定的模块。

从报错信息里可以看出是scipy的问题,我的scipy版本为最新的1.5.0,
解决方法:
尝试卸载,又重装scipy1.4.0,问题解决,问题在于scipy版本不兼容导致报错。
继续执行检测命令,顺利运行。检测输出保存在./inference/out文件夹下,检测结果如下:
在这里插入图片描述
未完待续,后续更新…

  • 6
    点赞
  • 57
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 13
    评论
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Linda Fan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值