pytorch与cuda版本对应下载

15 篇文章 1 订阅

在linux上执行pytorch程序时,代码要求pytorch版本>1.0,但安装后,由于cuda版本太低,导致运行出现错误,提示

AssertionError: 
The NVIDIA driver on your system is too old (found version 10000).
Please update your GPU driver by downloading and installing a new
version from the URL: http://www.nvidia.com/Download/index.aspx
Alternatively, go to: https://pytorch.org to install
a PyTorch version that has been compiled with your version

由于多人使用一台服务器,担心更新cuda后会造成其他问题,于是选择在不更新cuda的情况下,安装合适版本的pytorch

查看cuda版本:

 cat /usr/local/cuda/version.txt

查看当前pytorch是否支持当前机器的cuda命令为

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

若打印True,则可以,False则不支持

打开https://pytorch.org后,有相关提示不同平台,以及cuda对应的pytorch指令

然而,我的cuda版本为9.0,上面没有对应的,选择None后安装的pytorch也不能使用

在网上找了一番后,相关博客给出cuda

http://download.pytorch.org/whl/cu90/torch-1.1.0-cp36-cp36m-linux_x86_64.whl

亲测这个版本的torch1.0.0可支持cuda9.0

但如果还要安装torchvision,系统就会再次更新pytorch,又回导致不可用,因此要指定torchvision安装版本,如果不想更新torch的话  pip install torchvision==0.1.6

 

参考:

https://blog.csdn.net/weixin_36757190/article/details/100006182

https://blog.csdn.net/weixin_39965184/article/details/107363827

https://blog.csdn.net/hfutzhouyonghang/article/details/100884018/

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值