首先国内的可以先加个清华源,解决墙外下载慢的问题
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
可以查看一下当前源
conda config --get channels
可以设置一下下载时的源地址可见
conda config --set show_channel_urls yes
最后可以下载了,访问pytorch官网下载需要的版本,注意你的cuda和cudnn版本,如果没有nvidia的显卡可以下cpu版本,比如我这里下载1.11.0。注意后面的-c pytorch 要删除,加了这个就默认从官网下载,会很慢
conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cpuonly