1. Update the graphics card driver
First check your GPU model in the task manager,
Then go to the official website
https://www.nvidia.cn/Download/index.aspx?lang=cn
to find the corresponding version driver, click Search, and click Download.
Install the graphics driver and restart the computer.
win+R to bring up cmd, enter nvidia-smi
to go to CUDA official website
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
to check the corresponding cuda version, my 461.72 version can install the latest The 11.2 version of cuda is available, but for the sake of safety, I decided to install the 9.2 version following the teaching video.
To install cuda and cudnn, please refer to
https://blog.csdn.net/m0_37605642/article/details/98854753
2. Install anaconda
and enter the historical version of anaconda
https://repo.anaconda.com/
Click view all installers and
scroll down Find ↓ and download it,
Installation process: remember the installation path, click to subscribe to speed up the installation, do not install vs
3. Create a new virtual environment, install python3.6 in it and
open the anaconda prompt in the start menu,
Create a new environment named pytorch,
conda create -n pytorch python=3.6
activate the environment,
conda activate pytorch
(Activate it every time you use it, and use deactivate to exit the environment)
4. To install pytorch,
first replace the mirror source of Tsinghua University, the download is faster in the morning, and the download of hin is slower at night.
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
If you accidentally make a mistake, you can:
change back to the original source,
conda config --remove-key channels
View the current source,
conda config --show-sources
Install pytorch (corresponding to cuda9.2), when [y/N] appears, enter y.
If you are disconnected, just re-enter the installation command below.
conda install pytorch torchvision cudatoolkit=9.2
After the installation is successful, enter python to see the corresponding version information.
If you enter import torch and no error is reported, the installation is successful. If
you enter torch.cuda.is_available() and return true, you can use GPU acceleration.
5. Install pycharm
and refer to the video of station b:
https://www.bilibili.com/video/BV1hE411t7RN?p=2
6. Install jupyter
also refer to the above video, but the installation command I use is
conda install Jupyter notebook