• YOLOv5 环境搭建


    YOLOv5 环境搭建

    flyfish

    环境
    Ubuntu20.04
    驱动、CUDA Toolkit、cuDNN、PyTorch版本对应

    1 NVIDIA驱动安装

    在这里插入图片描述
    在[附加驱动界]面安装驱动时,需要输入安全密码,需要记下,后面还需要输入这个密码
    重启之后有的机器会出现
    在这里插入图片描述

    perform mok management
    操作步骤

    enroll mok 
    enroll mok -> continue 
    enroll the key -> yes 
    
    • 1
    • 2
    • 3

    输入安全密码 reboot

    2 CUDA Toolkit 安装

    https://developer.nvidia.com/cuda-toolkit-archive
    如果驱动已经安装,在这里可以不安装驱动
    在这里插入图片描述

    3 cuDNN 安装

    https://developer.nvidia.com/rdp/cudnn-archive
    在这里插入图片描述

    查看GPU信息

    nvidia-smi
    
    • 1

    System Management Interface

    https://developer.nvidia.com/nvidia-system-management-interface
    
    • 1

    在这里插入图片描述

    4 python环境

    (1)anaconda方式
    界面启动

    anaconda-navigator
    
    • 1

    使用国内源

    https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
    
    • 1

    在这里插入图片描述

    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/
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    运行 conda clean -i 清除索引缓存,保证用的是镜像站提供的索引。
    在这里插入图片描述
    创建虚拟环境

    conda create -n  yolov5
    
    • 1

    激活虚拟环境

    conda activate yolov5
    
    • 1

    退出conda环境

    conda deactivate
    
    • 1

    (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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17

    5 PyTorch安装

    https://pytorch.org/get-started/locally/
    
    • 1

    在这里插入图片描述

    6 Yolov5的安装

    下载源码

    https://github.com/ultralytics/yolov5
    
    • 1

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

    pip install -r requirements.txt
    
    • 1
  • 相关阅读:
    Spring Boot FailureAnalyzer 应用场景
    CSS笔记(黑马程序员pink老师前端)选择器,字体,文本属性,Emmet语法,元素显示模式,CSS背景
    亿达中国武汉园区入选“武汉市科技金融工作站”及“武汉市线下首贷服务站”
    1011 循环神经网络 RNN
    postgis 地理化函数
    资深博导:我以为数据预处理是常识,直到遇到自己的学生
    【数据结构】——链表面试题详解
    WebLogic JVM Core dumps文件的生成控制
    NPDP如何申请退考?你学会了吗?
    chapter 01 字符串的那些事
  • 原文地址:https://blog.csdn.net/flyfish1986/article/details/134553657