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
相关推荐
AI街潜水的八角10 小时前
基于YOLOv12课堂行为检测系统1:课堂行为检测数据集说明(含下载链接)
yolo
Coding茶水间11 小时前
基于深度学习的草莓健康度检测系统演示与介绍(YOLOv12/v11/v8/v5模型+Pyqt5界面+训练代码+数据集)
图像处理·人工智能·深度学习·yolo·目标检测·机器学习·计算机视觉
FL162386312914 小时前
传送带异物检测玻璃碴子检测数据集VOC+YOLO格式156张1类别
深度学习·yolo·机器学习
码上掘金16 小时前
基于YOLO与大语言模型的中医智能舌诊系统
人工智能·yolo·语言模型
OOOaaa12312317 小时前
机械紧固件智能识别系统 _ 基于YOLOv10n的螺栓螺母螺丝垫圈自动检测与分类
yolo·分类·数据挖掘
OOOaaa12312321 小时前
⸢ 捌-Ⅳ⸥⤳ YOLOv10n改进版:融合MAN-FasterCGLU-WFU架构的书籍封面检测系统
yolo·架构
ZCXZ12385296a21 小时前
YOLOv8-SDFM实现纸箱尺寸检测与分类系统详解
yolo·分类·数据挖掘
Coding茶水间1 天前
基于深度学习的螺栓螺母检测系统演示与介绍(YOLOv12/v11/v8/v5模型+Pyqt5界面+训练代码+数据集)
图像处理·人工智能·深度学习·yolo·目标检测·机器学习·计算机视觉
代码or搬砖1 天前
YOLOv8环境配置
yolo
AI小怪兽1 天前
RF-DETR:实时检测Transformer的神经架构搜索,首个突破 60 AP 的实时检测器 | ICLR 2026 in Submission
人工智能·深度学习·yolo·目标检测·架构·transformer