ubuntu20.04 安装cpu版本的pytorch 环境 简单记录~~

我要把这个环境命名为 pytorch_yukey

conda create --name pytorch_yukey

创建好了之后就激活

conda activate pytorch_yukey

把下载源换成清华源

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 --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

然后再输入

conda install pytorch torchvision cpuonly

 

安装好了之后 进入Python环境 测试一下

import torch

print(torch.__version__)#打印pytorch的版本

print(torch.cuda.is_available())#打印cuda是否可用,输出是False

 

posted on 2022-05-06 12:45  何大玥Yukey  阅读(185)  评论(1)    收藏  举报