如何使用conda下载清华源的pytorch(带cuda版本)
2024.01.17 23:13浏览量:554简介:使用conda在清华源下载带cuda的pytorch,让你的PyTorch安装过程更快速,更便捷。
在conda中添加清华源并下载pytorch,你需要按照以下步骤进行:
- 打开终端或命令提示符窗口,并激活你的conda环境(如果你还没有创建环境的话)。
- 添加清华源到conda的channels。运行以下命令:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainconda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/freeconda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/rconda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/proconda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
- 确认你的清华源已经添加成功。运行以下命令:
这将显示你当前的所有channels,包括清华源。conda config --show channels
- 接下来,你可以使用conda安装pytorch。运行以下命令:
注意,conda install pytorch torchvision torchaudio -c pytorch-cpu -c pytorch-rnn -c pytorch-msys2
-c pytorch-cpu,-c pytorch-rnn和-c pytorch-msys2这些参数是用来指定从哪个channel下载pytorch的。由于pytorch没有提供清华源的channel,所以这里我们用到了其他的一些channel。你可以尝试其他的channel或者在清华源中寻找pytorch的相关channel。 - 等待安装完成。这将根据你的网络速度和电脑性能来决定需要多长时间。安装完成后,你就可以在你的环境中使用pytorch了。
通过以上步骤,你应该可以在清华源中下载并安装带cuda的pytorch。如果你在过程中遇到任何问题,欢迎随时向我提问。

发表评论
登录后可评论,请前往 登录 或 注册