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
相关推荐
王锋(oxwangfeng)1 小时前
YOLOWorld 实现开集障碍物检测
yolo
喵叔哟1 小时前
02-YOLO-v8-v9-v10工程差异对比
人工智能·yolo·机器学习
2501_9413331017 小时前
数字识别与检测_YOLOv3_C3k2改进模型解析
人工智能·yolo·目标跟踪
xsc-xyc20 小时前
RuntimeError: Dataset ‘/data.yaml‘ error ❌ ‘_lz
人工智能·深度学习·yolo·计算机视觉·视觉检测
张3蜂21 小时前
我希望做的是识别身份证正反面,我需要标注多少张图片?
yolo
AAD555888991 天前
YOLOv8-MAN-Faster电容器缺陷检测:七类组件识别与分类系统
yolo·分类·数据挖掘
AI浩1 天前
YOLO-IOD:面向实时增量目标检测
yolo·目标检测·目标跟踪
wfeqhfxz25887821 天前
YOLOv8-BiFPN鸟巢目标检测与识别实战教程
yolo·目标检测·目标跟踪
Katecat996631 天前
基于YOLOv8和MAFPN的骆驼目标检测系统实现
人工智能·yolo·目标检测
ZCXZ12385296a1 天前
YOLOv8_HSPAN_机器人视觉系统中的球体目标检测与追踪_1
yolo·目标检测·机器人