设置清华镜像下载:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64
从pytorch官方网址pytorch.org获得conda命令:
conda install pytorch torchvision torchaudio cudatoolkit=11.1
安装过程:
Collecting package metadata (current_repodata.json): done
Solving environment: done
Package Plan
environment location: C:\Users\Administrator\anaconda3
added / updated specs:
- cudatoolkit=11.1
- pytorch
- torchaudio
- torchvision
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2021.4.13 | haa95532_1 115 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
certifi-2020.12.5 | py38haa95532_0 141 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda-4.10.1 | py38haa95532_1 2.9 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
openssl-1.1.1k | h2bbff1b_0 4.8 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pytorch-1.8.1 |py3.8_cuda11.1_cudnn8_0 1.53 GB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
torchaudio-0.8.1 | py38 2.7 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
torchvision-0.9.1 | py38_cu111 7.5 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
------------------------------------------------------------
Total: 1.55 GB
The following NEW packages will be INSTALLED:
torchaudio anaconda/cloud/pytorch/win-64::torchaudio-0.8.1-py38
torchvision anaconda/cloud/pytorch/win-64::torchvision-0.9.1-py38_cu111
The following packages will be SUPERSEDED by a higher-priority channel:
ca-certificates pkgs/main --> anaconda/pkgs/main
certifi pkgs/main --> anaconda/pkgs/main
conda pkgs/main --> anaconda/pkgs/main
openssl pkgs/main --> anaconda/pkgs/main
pytorch pytorch --> anaconda/cloud/pytorch
Proceed ([y]/n)? y
按y键开始安装,但是由于总下载量很大,约2.4GB,需要很长时间。