• 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
  • 相关阅读:
    牛客刷题——剑指offer(第五期)
    OpenCV-滤波矩阵(java版)
    证件照电子版怎么做?这几个软件能帮你
    pytorch的卷积层池化层和非线性变化 和机器学习线性回归
    Redis持久化RDB,AOF
    Mysql语法四:索引查找和了解何为事务
    mysql之MHA
    360T7路由器进行WiFi无线中继教程
    剪切的东西不见了怎么找回来?
    智能健身动作识别:PP-TinyPose打造AI虚拟健身教练!
  • 原文地址:https://blog.csdn.net/flyfish1986/article/details/134553657