YOLOv5 环境搭建

YOLOv5 环境搭建

flyfish

环境

Ubuntu20.04

驱动、CUDA Toolkit、cuDNN、PyTorch版本对应

1 NVIDIA驱动安装

附加驱动界面安装驱动时,需要输入安全密码,需要记下,后面还需要输入这个密码

重启之后有的机器会出现

perform mok management

操作步骤

复制代码
enroll mok 
enroll mok -> continue 
enroll the key -> yes 

输入安全密码 reboot

2 CUDA Toolkit 安装

https://developer.nvidia.com/cuda-toolkit-archive

如果驱动已经安装,在这里可以不安装驱动

3 cuDNN 安装

https://developer.nvidia.com/rdp/cudnn-archive

查看GPU信息

复制代码
nvidia-smi

System Management Interface

复制代码
https://developer.nvidia.com/nvidia-system-management-interface

4 python环境

(1)anaconda方式

界面启动

复制代码
anaconda-navigator

使用国内源

复制代码
https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
复制代码
channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  deepmodeling: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/

运行 conda clean -i 清除索引缓存,保证用的是镜像站提供的索引。

创建虚拟环境

复制代码
conda create -n  yolov5

激活虚拟环境

复制代码
conda activate yolov5

退出conda环境

复制代码
conda deactivate

(2)python虚拟环境方式

复制代码
sudo apt-get install python3-venv

# 配置国内源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

#创建虚拟环境
python3 -m venv  yolov5

#激活虚拟环境
cd venv_name
source bin/activate

# pip 升级
pip install --upgrade pip

#退出激活环境
deactivate

5 PyTorch安装

复制代码
https://pytorch.org/get-started/locally/

6 Yolov5的安装

下载源码

复制代码
https://github.com/ultralytics/yolov5

在自己的环境,进入代码目录

执行

复制代码
pip install -r requirements.txt
相关推荐
大鱼>4 天前
地平线BPU部署实战:YOLOv8在J5/X3上的算法适配与性能优化
算法·yolo·性能优化
stsdddd4 天前
YOLO系列目标检测数据集大全【第二十九期】
yolo·目标检测·目标跟踪
大鱼>4 天前
YOLO边缘部署深度指南:从YOLOv8n到NPU加速的全链路优化
yolo·aiot
AI棒棒牛4 天前
第 03 讲《监督学习:数据、标签、Loss与训练循环》
人工智能·学习·yolo·目标检测·yolo26
FL16238631294 天前
国内快递面单识别检测数据集VOC+YOLO格式422张6类别
人工智能·yolo·机器学习
stsdddd4 天前
YOLO系列目标检测数据集大全【第三十期】
yolo·目标检测·目标跟踪
YOLO数据集集合4 天前
无人机航拍地质灾害智能识别 山体滑坡实例分割数据集落地实战 | 泥石流监测 道路险情封堵 深度学习模型训练方案10296期
人工智能·深度学习·yolo·目标检测·无人机
音沐mu.4 天前
【73】墙壁建筑缺陷数据集(有v5/v8模型)/YOLO墙壁建筑缺陷检测
yolo·目标检测·目标检测数据集·墙壁建筑缺陷数据集·墙壁建筑缺陷检测
前网易架构师-高司机4 天前
带标注的辣椒病叶数据集,识别率95.9%,可识别三种病害和健康叶子,9916张图,支持yolo,coco json,voc xml,文末有模型训练代码
yolo·json·数据集·病害·叶病·病叶·辣椒
动物园猫4 天前
直升机停机坪目标检测数据集分享(适用于YOLO系列深度学习分类检测任务)
深度学习·yolo·目标检测