pip install torch online installation! Not offline!

pip install torch online installation! Not offline! Pro test so good!

Foreword:

Baidu can't find a reliable pip online installation torch tutorial?
People in the lab are talking about downloading offline and then installing?
Change the domestic source, although it is very fast at the beginning, but halfway through the download, the following bugs will appear:

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPoo
l(host=‘pypi.tuna.tsinghua.edu.cn’, port=443): Read timed out.

Is this reasonable? This is unreasonable~
I am familiar with the timed out error report. Isn't this just a little bit to set the time-out default parameters?

pytorch online installation steps:

  1. Change the domestic source: For the permanent version of the tutorial, see pip in Ubuntu to manually add the domestic source
    Temporary time-out version
pip install torch -i  http://pypi.douban.com/simple  --trusted-host pypi.douban.com
  1. Set the default time:
pip --default-timeout=100 install torch

Final command:

pip --default-timeout=100 install torch -i  http://pypi.douban.com/simple  --trusted-host pypi.douban.com
  1. Torch and torchvision version match:
    look at the official website https://pytorch.org/get-started/previous-versions/ to
    find the corresponding version:
    Insert picture description here

  2. If you do not specify the version, an error will be reported!

pip install torch torchvision

Guess you like

Origin blog.csdn.net/hehedadaq/article/details/111480313