一、给conda添加清华源优化下载

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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes#下载时显示文件来源

二、在官网获取conda命令行进行下载

Pytorch官网选择对应版本,复制对应语句,在Anaconda对应环境下执行。(CUDA版本可用nvcc -V命令查询)
注意,语句需去除-c及后面部分,若不删掉,则还是在default源下载
在这里插入图片描述
以本人适合的环境为例:
conda install pytorch torchvision torchaudio cudatoolkit=11.3

三、下载成功!

在这里插入图片描述

四、测试

版本号成功输出,环境配置成功!
在这里插入图片描述

附录 - Jupyter Notebook中输出版本号报错问题

在Anaconda Navigator中选择对应环境,下载Jupyter Notebook。
在这里插入图片描述
下载完成后,在开始菜单点击对应Jupyter Notebook启动。
在这里插入图片描述
即可成功!
在这里插入图片描述

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐