20220715 国内Conda不fq安装Pytorch最新版本的方法

文章目录

*
问题描述
解决办法
References

问题描述

举个例子在 PyTorch官网瞅到命令如下

20220715 国内Conda不fq安装Pytorch最新版本的方法

在GPU服务器没配置fq的情况下,设置好了国内的源,比如清华源/阿里源.

.condarc文件如下

channels:
  - http://mirrors.aliyun.com/anaconda/pkgs/main
  - http://mirrors.aliyun.com/anaconda/pkgs/r
  - http://mirrors.aliyun.com/anaconda/pkgs/msys2
show_channel_urls: true

死活无法安装11以上的cuda. conda/pip安装都试过了, 配置的都是国内源. 可以通过pip安装10.2的, 但是安培架构的GPU NVIDIA RTX A5000不开心, 在测试GPU版本Pytorch是否OK时, 它说

Your Ampere GPU needs CUDA11+ while your current installation uses cudatoolkit=10.2 and will thus not work. The CUDA10.2 binaries are also not shipping sm_86 for the same reason. Install the CUDA11.3 binary and it should work. If you are hitting conflicts, create a new conda environment and install...

官方给的命令里 -c是从Pytorch官方源下载的意思. 可能是没fq吧, 怎么着也下不了.

解决办法

访问Index of /anaconda/cloud/pytorch/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

  1. 确定你所需的系统类型, 比如 Linux64, 进入对应目录
  2. 再来Previous PyTorch Versions | PyTorch确定对应的cuda , torch版本. 例如 conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=10.2 -c pytorch
  3. 然后把 -c后面的pytorch替换为第一步系统版本对应的那个链接 比如Linux64对应的就是 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/

最后我的Ubuntu用的命令是:

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64

References

国内源安装pytorch的方法 – 知乎 (zhihu.com)

Original: https://blog.csdn.net/Drifter_Galaxy/article/details/125810335
Author: Abernorland
Title: 20220715 国内Conda不fq安装Pytorch最新版本的方法

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/772019/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球