查看 CUDA \cudnn版本,使用conda/pip安装pytorch教程(mac/windos/linux) 和卸载

2019.9.18

安装时候仔细看安装说明,cuda、cudnn、系统的版本需要对应。

2019.01.01 更新

可以直接去官网看安装指令,里面也有一些旧版本的指令入口:https://pytorch.org/

2019.02.16 更新

网速问题的话,安装指令示意:https://blog.csdn.net/m0_37644085/article/details/87446922

#阿里云
eg:安装:
pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com torch
eg:更新:
pip install --upgrade -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com torch
#清华
eg:更新
pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host https://pypi.tuna.tsinghua.edu.cn/ torch  
eg:安装:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host https://pypi.tuna.tsinghua.edu.cn/ torch  

 

 一、查看版本

先查看 CUDA 版本:

cat /usr/local/cuda/version.txt

查看 CUDNN 版本:

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

二、测试

在终端中按以下顺序运行命令:

python

在打开的python命令行中运行

import torch
print(torch.cuda.is_available())

不报错的话即代表安装成功。最好再测个cuda能不能用,返回True。

三、卸载Pytorch

1、使用conda卸载Pytorch

conda uninstall pytorch 
conda uninstall libtorch

2、使用pip卸载Pytorch

pip uninstall torch
 
  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值