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
相关推荐
FL16238631291 天前
[C#][winform]基于yolov11的阿尔兹海默症严重程度检测系统C#源码+onnx模型+评估指标曲线+精美GUI界面
yolo
AI浩1 天前
SMA-YOLO:一种基于无参注意力机制和多尺度特征融合的改进YOLOv8算法,用于无人机图像中的小目标检测
算法·yolo·无人机
云空1 天前
《Debian 系统上部署 YOLO11》
人工智能·神经网络·yolo·debian
乐园游梦记1 天前
使用OpenCvSharp的DNN模块加载YOLOv11的ONNX模型,涉及将模型文件路径传递给DNN模块的相关函数。
人工智能·深度学习·opencv·yolo·c#·dnn
乐园游梦记1 天前
在VS的winform中基于C#和OPenCV实现基于python的yolo模型深度学习的使用与训练
python·深度学习·opencv·yolo·c#·visual studio
FL16238631292 天前
[C#][winform]基于yolov11的鱼病害检测系统C#源码+onnx模型+评估指标曲线+精美GUI界面
yolo
Coding茶水间2 天前
基于深度学习的船舶检测系统演示与介绍(YOLOv12/v11/v8/v5模型+Pyqt5界面+训练代码+数据集)
图像处理·人工智能·深度学习·yolo·目标检测·计算机视觉
羊羊小栈2 天前
基于「YOLO姿态识别 + AI大模型分析」的智能健身辅助系统(vue+flask+AI算法)
vue.js·人工智能·yolo·毕业设计·创业创新·大作业
FL16238631292 天前
[C#][winform]基于yolov11的无人机飞鸟检测系统C#源码+onnx模型+评估指标曲线+精美GUI界面
yolo·无人机