Deep learning environment configuration (deepin20.6)
yolov5 first introduction (win version)
1. Install miniconda:
1. Download: Miniconda3-latest-Windows-x86_64.exe
Then click "next" to install everything.
2. Conda source change
Create a .condarc file in the current user directory ("C:\Users\xxx"):
conda config --set show_channel_urls yes
Add to:
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
The result is as follows:
Clear the index cache:
conda clean -i
3. Create a virtual environment:
In the "Start Menu" you find the image below
. Enter:
conda create -n yolov5_env python=3.8
tips:
# 查看创建过的虚拟环境
conda env list
# 切换至xxx环境
conda activate xxx
or
conda activate C:\ProgramData\Miniconda3\envs\xxx
# 查看当前环境下安装的第三方库
conda list
# 删除虚拟环境
conda remove -n xxx --all
# 安装第三方库:优先级:conda > pip > 编译
# 删除环境中的某个包
conda remove -n xxx yyy
2. Install cuda and cudnn
cuda download , select 10.2 for graphics cards before 30 series, select 11.1.1 for 30 series graphics cards
cudnn download (requires registration and login) , select the corresponding cudnn according to the cuda version (recommended cuda10.2+cudnn7.6.5, cuda11.1+cudnn8.1.1 )
1. Install cuda:
Add environment variables:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\libnvvp
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\lib\x64
verify:
nvcc -V
2. Install cudnn:
Unzip:
Copy to the corresponding cuda installation directory:
3. pip source change reference:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn