当前位置:   article > 正文

pip install torch及对应torchvision、torchaudio

pip install torch

在这个链接中找你需要下的torch版本,会自动帮你匹配好torchvision、torchaudio版本,生成一个pip命令如下:
https://pytorch.org/get-started/previous-versions/

(base) E:\Python\workspace>pip install torch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0

  • 1
  • 2

在终端Terminal 中输入以上结果后,就自动帮你安装了。如下:

(base) E:\Python\workspace>pip install torch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0
Collecting torch==1.8.0
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))': /packages/fc/d2/c76c193c8ca4307ffa365c40e6ec6f5d1783d8e9310bf6311da91694ac01/torch-1.8.0-cp39-cp39-win_amd64.whl
  Downloading torch-1.8.0-cp39-cp39-win_amd64.whl (190.5 MB)
     ---------------------------------------- 190.5/190.5 MB 8.4 MB/s eta 0:00:00
Collecting torchvision==0.9.0
  Downloading torchvision-0.9.0-cp39-cp39-win_amd64.whl (852 kB)
     ---------------------------------------- 852.5/852.5 kB 7.7 MB/s eta 0:00:00
Collecting torchaudio==0.8.0
  Downloading torchaudio-0.8.0-cp39-none-win_amd64.whl (109 kB)
     ---------------------------------------- 109.0/109.0 kB 1.6 MB/s eta 0:00:00
Requirement already satisfied: numpy in e:\python_2\anaconda3\lib\site-packages (from torch==1.8.0) (1.21.5)
Requirement already satisfied: typing-extensions in e:\python_2\anaconda3\lib\site-packages (from torch==1.8.0) (4.3.0)
Requirement already satisfied: pillow>=4.1.1 in e:\python_2\anaconda3\lib\site-packages (from torchvision==0.9.0) (9.2.0)
Installing collected packages: torch, torchvision, torchaudio
Successfully installed torch-1.8.0 torchaudio-0.8.0 torchvision-0.9.0

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/458766
推荐阅读
相关标签
  

闽ICP备14008679号