anaconda+pycharm+pytorch-gpu installation (Windows)

Install anaconda+pycharm

Just look at the links below.
Reprinted: https://www.cnblogs.com/zhangkanghui/p/10756630.html

Install cuda+cudnn

1. Check the cuda version corresponding to the graphics card driver version

First open the Control Panel, find "Programs and Features" to check the system graphics card driver version.
Please add a picture description
The 398.27 in the picture above, and then go here to check the corresponding cuda version, this table.Please add a picture description

2. Download and install corresponding CUDA

Go here to download the corresponding cuda, and run it as an administrator after downloading.
Select custom installation, and decide whether to install according to the version of each option. Please add a picture description
Note: Remove the Visual Studio integration option in Customization.

Then test it, enter the dos command in the win terminal

nvcc -V

Note: Here V is uppercase
output

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Tue_Jun_12_23:08:12_Central_Daylight_Time_2018
Cuda compilation tools, release 9.2, V9.2.148

Then the installation is successful.

3. Download and install the corresponding CUDNN

To download the library corresponding to cuda on the NVIDIA website , you need to register an account.
After downloading, unzip and copy the .h .lib and .dll files to the corresponding folders in the cuda installation directory.
At this point, the installation should be successful. As for adding the environment, I have not found that it must be added so far. If there is a problem, I will add it later.

4. Download the corresponding version of pytorch

First enter the environment corresponding to anaconda, then go to the pytorch official website to download the version you need, and paste the pytorch download command into the environment corresponding to anaconda to install it.
After the installation is complete, enter python and use the following command to test:

import torch
torch.cuda.is_avaliable()
>>>True  # 这里返回true表示gpu版本的pytorch安装成功。

Guess you like

Origin blog.csdn.net/Adam897/article/details/126493501