Pytorch learning - installation environment

python 3.8;anaconda 3-2023-3-1;cuda 11.7.0;cudnn;pytorch

1. Python 3.8 installation:

2. Anaconda installation

1. Visit Free Download | Anaconda

2. Download the installation package and install it

During the installation process, you need to pay attention to the file path where anaconda is installed, and other options can be defaulted

Also, skip installing Visual Studio

3. Verify that the installation is successful

Click the start menu, find Anaconda prompt , open it, and if (base) is displayed in front , it means success.

 

3. Download CUDA

1. Baidu search cuda, select the first one. After entering the page, pull down the page and click download now. Then find the historical version, and find the version you want to install in it. (See picture notes)

 

 

 Note that the version of CUDA depends on the version of pytorch you downloaded

 

4. cuDNN Download

1. Similarly, we search for cuDNN (cudnn is necessary) (refer to image annotation)

 

The download here needs to log in to the NVIDIA account. It is recommended to use Science Online to register an account. The registration process is similar, mainly using Science Online

 

 

5 Install CUDA & cuDNN

It is recommended to use the default path during installation to avoid errors

1. After successfully downloading CUDA and cuDNN, the next step is to install them. Let’s start the demonstration

2. Install CUDA

1 Note: When this address is zero, the decompression path will be deleted after the installation is complete

 

 2 Agree to terms

3 Select -> Customize

4 Uncheck Visual Studio Integration

5 The location here is the real installation path

 6 Click Next and wait for the installation to complete

 3 Install cuDNN

1. Unzip the cuDNN file

 2. Copy bin, include, lib to CUDA file

Open cmd and enter set cuda 

 The environment variables here are automatically set after installing CUDA, but two environment variables need to be configured, which will be mentioned in a section

 4. Configure environment variables

1 Enter the advanced settings and configure environment variables for it

 2 Add bin include lib libnvvp to the environment variable

5 verify cuda

6 install pytorch

1. Open Anaconda, enter the coda command,

During the installation, enter y 

2. Activate pytorch

The prefix becomes (pytorch) to indicate successful activation

3. Install pytorch

Select according to the CUDA installed above; then copy the instructions for execution

 Select y and wait for the installation to complete

 

Guess you like

Origin blog.csdn.net/weixin_43537097/article/details/130925870