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棒棒牛15 小时前
基于 IDEAL 思想的 YOLO26 双分支适配:差异证据与不确定性门控,RGB+IR双分支创新!
人工智能·深度学习·yolo·目标检测·yolo26
qq_25294131681 天前
多模态屋顶损伤与杂物检测数据集 | 屋顶检测 多模态 红外可见光 建筑巡检 目标检测9232期
人工智能·深度学习·yolo·目标检测·计算机视觉·屋顶
jay神2 天前
基于 YOLOv11 的无人机航拍小目标检测系统
人工智能·深度学习·yolo·目标检测·计算机视觉·无人机·计算机毕业设计
jay神2 天前
基于 YOLOv8 的手势识别系统
人工智能·深度学习·yolo·机器学习·计算机视觉·目标跟踪·课程设计
qq_25294131682 天前
不同成熟度番茄果实多模态图像数据集 | 番茄成熟度 多模态检测 可见光深度红外 智慧农业 语义分割 目标检测9233期
人工智能·yolo·目标检测·目标跟踪·番茄多模态
jay神2 天前
基于 YOLOv8 的垃圾分类识别系统
人工智能·深度学习·yolo·机器学习·目标跟踪·分类·计算机毕业设计
qq_25294131682 天前
航拍地面垃圾检测数据集 | 垃圾检测 航拍巡检 环境治理 目标检测 YOLO格式9224期
人工智能·yolo·目标检测·计算机视觉·垃圾检测·航拍地面
fleaxin2 天前
Atlas 300V:(3)模型精度数据对比
yolo·华为·atlas
jay神2 天前
基于 YOLOv8 与 Faster R-CNN 的盲道障碍检测系统
人工智能·深度学习·yolo·计算机视觉·cnn·课程设计·计算机毕业设计
jay神2 天前
基于 YOLOv8 的无人机识别与检测系统
人工智能·深度学习·yolo·计算机视觉·无人机·课程设计·计算机毕业设计