RTX3060+cuda+pytorch的问题

机械革命X8Pro --RTX3060
在cmd训练其他没问题,在spyder写了一个神经网络,需要调用cuda,结果报错如下:

GeForce RTX 3060 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.

问题原因:pytorch版本与cuda版本不对应。

一、查看cuda版本
右击桌面,NVIDIA控制面板–系统信息–组件,我们可以看到我的版本是cudaa11.1
在这里插入图片描述
在这里插入图片描述
二、查看pytorch版本
运行cmd:
输入命令:
import torch
print(torch.version)
可以看到我们的pytorch版本是1.6.0在这里插入图片描述
三、查看算力,算力不匹配也会报错

如果你gpu算力是7.5的话,算力是7的cuda可以在上边运行,但算力为7.5的cuda不能够在算力为7的gpu上运行。算力为7的cuda不能够在算力为8的gpu上运行。)说人话,就是cuda算力要低于或等于gpu的算法,但是跨版本就不行。
https://www.nvidia.cn/Download/index.aspx?lang=cn#
在这里插入图片描述
在这里插入图片描述可以看到我们的版本是461.92.,所对应的cuda版本没有问题:
在这里插入图片描述

接下来我们看一下pytorch对应版本是否有问题:
https://pytorch.org/get-started/previous-versions/
在这里插入图片描述
我们可以看到cuda版本如果是11.1,那么所对应torch的版本应该是v1.8.0,但是我们刚才查看版本是1.6.0。接下来就简单啦。升级我们的pytorch。
复制上图对应11.1的命令到cmd又出现如下报错:
torchvision 0.7.0+cu101 has requirement torch1.6.0, but you’ll have torch 1.8.0 which is incompatible.
那我们就单独再download一遍:
pip install --upgrade torchvision
0.9.0
报错如下:
Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: ‘d:\anaconda3.7\anaconda\lib\site-packages\torch\_c.cp37-win_amd64.pyd’
Consider using the --user option or check the permissions.

在这里插入图片描述

解决方法:
pip install --user --upgrade torchvision==0.9
在这里插入图片描述
再次运行我们的CNN:
在这里插入图片描述

  • 6
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值