Windows系统在YOLOV5环境的搭建

一、参考博客和注意问题

一、 参考博客:

pytorch训练自己的YOLOv5目标检测器(自定义数据集训练)
WIN10下YOLOV5安装与测试-踩坑记会发现我们下载的requirements.txt与博主的不一样,源码发生了变化注意:不要采用 pip install -U -r requirements.txt原因:应该只支持Linux和macos系统,对于window系统还是采用下面的操作进行配置。
在这里插入图片描述

二、 安装Anaconda、 安装VS2015、安装CUDA10.2.89、CUDNN7.6.5(操作看我的Tensorflow object detection api(maskrcnn的搭建流程)

三、 创建虚拟环境:conda create -n yolov5 python=3.7

四 6.1为conda设置清华源:打开Anaconda Prompt,输入清华仓库镜像,这样更新会快一些:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

6.2使用 pip install 时,可以在代码最后附上以下清华镜像源代码加快下载速度:

-i https://pypi.tuna.tsinghua.edu.cn/simple

五、 在虚拟环境安装cuda和cudnn和安装各种库:

conda install cudatoolkit==10.2.89
conda install cudnn==7.6.5
pip install numpy==1.17 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install tqdm -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install tensorboard -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install pyyaml -i https://pypi.tuna.tsinghua.edu.cn/simple
# pip install git -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install scikit-image -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install Cython -i https://pypi.tuna.tsinghua.edu.cn/simple 
pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple 

六 、 pycocotools安装,下载连接:,并解压;

百度网盘包:

链接:https://pan.baidu.com/s/1J3O-VmnRrYqNBEEpEXAo6A
提取码:qqmu
以管理员身份打开 CMD 终端,并切换到 cocoapi\PythonAPI目录。运行以下指令:

cd D:\software\CNN_package\cocoapi-master\PythonAPI
d:
# install pycocotools locally
python setup.py build_ext --inplace
# install pycocotools to the Python site-packages
python setup.py build_ext install

七、 安装pytorch 1.5.1

pip install torch===1.5.1 torchvision===0.6.1 -f https://download.pytorch.org/whl/torch_stable.html -i https://pypi.tuna.tsinghua.edu.cn/simple
# pip install torch===1.5.0 torchvision===0.6.0 -f https://download.pytorch.org/whl/torch_stable.html -i https://pypi.tuna.tsinghua.edu.cn/simple

九、 1.1.1 :下载yolov5源码
十、 1.1.2. 下载yolov5模型(.pt文件)
十一、 测试:

cd E:\yolov5
e:
python detect.py --source ./inference/images/ --weights ./weights/yolov5s.pt --conf 0.4
python detect.py --source 0

在这里插入图片描述

十二、训练vo从2012年的数据集

1、修改voc.yaml这几部分内容根据自己的数据
在这里插入图片描述
修改yolov5s.yaml的类别数
在这里插入图片描述
对数据集进行训练

python train.py --weights weights/yolov5s.pt

在runs文件夹下有本次训练的模型

在这里插入图片描述
查看训练过程中各个指标的变化
在这里插入图片描述

  • 5
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值