python installation pytorch

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq_39377418/article/details/100336356

python when installing pytorch, it is easy to make a mistake, most third-party libraries are to be installed by the end-use pip command, however pytorch to show his special, direct pip install if that does not work, because the installation command need to obtain the corresponding command to install from the official website

The first step: look Quguan network

Official website:  https://pytorch.org/

Step Two: Select and match their own version shown here is what I choose to install. 

We first have to make choices about their operating environment, then our people will give a corresponding installation command, and then execute this command in Terminal on it

The third step: a successful installation:

E.g :

C:\Users\Administrator>pip3 install http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-win_amd64.whl
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting torch==0.4.1 from http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-win_amd64.whl
  Downloading http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-win_amd64.whl (55.9MB)
     |████████████████████████████████| 55.9MB 251kB/s
Installing collected packages: torch
Successfully installed torch-0.4.1
C:\Users\Administrator>pip3 install torchvision
Collecting torchvision
  Downloading https://files.pythonhosted.org/packages/ca/0d/f00b2885711e08bd71242ebe7b96561e6f6d01fdb4b9dcf4d37e2e13c5e1/torchvision-0.2.1-py2.py3-none-any.whl (54kB)
    100% |████████████████████████████████| 61kB 120kB/s
Requirement already satisfied: numpy in C:\Users\Administrator\appdata\local\programs\python\python36\lib\site-packages (from torchvision) (1.15.3)
Requirement already satisfied: six in C:\Users\Administrator\appdata\local\programs\python\python36\lib\site-packages (from torchvision) (1.11.0)
Collecting pillow>=4.1.1 (from torchvision)
  Downloading https://files.pythonhosted.org/packages/bd/39/c76eaf781343162bdb1cf4854cb3bd5947a87ee44363e5acd6c48d69c4a1/Pillow-5.3.0-cp36-cp36m-win_amd64.whl (1.6MB)
    100% |████████████████████████████████| 1.6MB 81kB/s
Requirement already satisfied: torch in C:\Users\Administrator\appdata\local\programs\python\python36\lib\site-packages (from torchvision) (0.4.1)
Installing collected packages: pillow, torchvision
Successfully installed pillow-5.3.0 torchvision-0.2.1

You can use the successful implementation of

 

 

Guess you like

Origin blog.csdn.net/qq_39377418/article/details/100336356