怎么用conda下载清华源的pytorch(自带cuda的版本)

1,添加镜像源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

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/r

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
Anaconda 添加清华镜像源_conda添加清华源_小金~~的博客-CSDN博客

2,打开 ~/.condarc

把原来的删除,把下面的填进去

复制代码
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
auto_activate_base: false
show_channel_urls: true

3,执行这个命令

复制代码
conda install pytorch=1.12.1 cudatoolkit=11.6

conda 清华源安装 PyTorch CUDA 版本 - 知乎

4,验证

import torch

torch.cuda.is_available()

个人理解:

pytorch 是要安装的

cuda也要安装

但是有的pytorch安装的时候会把cuda一块安好,不用自己装了

相关推荐
Macbethad2 分钟前
基于世界模型的自动驾驶控制算法
人工智能·机器学习·自动驾驶
带电的小王3 分钟前
【AI大模型技术】4.预训练语言模型(PLMs,Pre-trained Langue Models);5.Transformers Tutorial
人工智能·语言模型·自然语言处理
搬砖者(视觉算法工程师)11 分钟前
自动驾驶技术前沿:传感器技术
人工智能·自动驾驶
_codemonster39 分钟前
深度学习实战(基于pytroch)系列(五)线性回归的pytorch实现
pytorch·深度学习·线性回归
算法与编程之美40 分钟前
探究pytorch中多个卷积层和全连接层的输出方法
人工智能·pytorch·深度学习·神经网络·cnn
Master_oid1 小时前
机器学习21:可解释机器学习(Explainable Machine Learning)(上)
人工智能·机器学习
MobotStone1 小时前
边际成本趋近于零:如何让AI智能体"说得清、讲得明"
人工智能·架构
新智元1 小时前
李飞飞「世界模型」正式开放,人人可用! Pro 版首月仅 7 元
人工智能·openai
新智元1 小时前
GPT-5.1 凌晨突袭,奥特曼听劝!全网呼唤的人味回来了
人工智能
钅日 勿 XiName1 小时前
一小时速通Pytorch之自动梯度(Autograd)和计算图(Computational Graph)(二)
人工智能·pytorch·python