https://pytorch.org/get-started/locally/#linux-package-manager
进入官网,选择版本配置,得到如下,本人的配置是Ubuntu的,根据自己需要选择:
pip3 install torch1.9.1+cu111 torchvision0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
若下载速度太慢,复制打开https://download.pytorch.org/whl/torch_stable.html,直接下载,下载后运行pip install /下载路径/torch-1.8.0+cu111-cp37-cp37m-linux_x86_64.whl,如:
pip install /pretrain_model/torch-1.8.0+cu111-cp37-cp37m-linux_x86_64.whl
安装完成后再次运行pip3 install torch1.9.1+cu111 torchvision0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html,会继续安装 torchvision,torchaudio,若下载特别慢也可以用同样的方法,完成安装。



