logo

如何使用conda下载清华源的pytorch(带cuda版本)

作者:4042024.01.17 23:13浏览量:554

简介:使用conda在清华源下载带cuda的pytorch,让你的PyTorch安装过程更快速,更便捷。

在conda中添加清华源并下载pytorch,你需要按照以下步骤进行:

  1. 打开终端或命令提示符窗口,并激活你的conda环境(如果你还没有创建环境的话)。
  2. 添加清华源到conda的channels。运行以下命令:
    1. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    2. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    3. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
    4. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
    5. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
  3. 确认你的清华源已经添加成功。运行以下命令:
    1. conda config --show channels
    这将显示你当前的所有channels,包括清华源。
  4. 接下来,你可以使用conda安装pytorch。运行以下命令:
    1. 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。
  5. 等待安装完成。这将根据你的网络速度和电脑性能来决定需要多长时间。安装完成后,你就可以在你的环境中使用pytorch了。
    通过以上步骤,你应该可以在清华源中下载并安装带cuda的pytorch。如果你在过程中遇到任何问题,欢迎随时向我提问。

相关文章推荐

发表评论

活动