Pytorch's official website address
At present, the latest version of Pytorch version is 1.4, supporting the latest cuda9.2 and 10.1
according to its own CUDA version, you can choose the appropriate Pytorch version
(Must choose to adapt to the CUDA version of your own computer or server, otherwise you will make an error!)
Click the red letter install previous versions of PyTorch in the picture below,
which is this URL: https://pytorch.org/get-started/previous-versions/
See the following interface:
select the corresponding version command as needed.
Here I installed based on CUDA9.0 and Anaconda, so the selected command is:
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0
Note that "-c pytorch" is deleted here. The pre-configured domestic mirror source will be used, and the download speed will be much faster. The specific configuration method is very simple, but I will repeat it.
After the installation is complete, enter:
python
Enter the python environment of anaconda
and enter:
import torch
import torchvision
print(torch.__version__)
print(torchvision.__version__)
Get the following display,
you can enter again:
print(torch.cuda.is_available())
Display: True
The installation is complete!