出现错误(已解决)RuntimeError: CUDA error: no kernel image is available for execution on the device CUDA ker

出现问题(已解决)RuntimeError: CUDA error: no kernel image is available for execution on the device CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

问题——警告

为什么把警告po出来,是因为警告可以让我们了解一些有用信息。
在这里插入图片描述

问题——错误

在这里插入图片描述

分析原因

首先警告里的内容不可忽略,翻译过来就是NVIDIA RTX GeForce 3060Ti(我使用的服务器)支持的CUDA的算力为8.6,与当前的pytorch的版本不匹配。说白了就是CUDA和pytorch版本不一致。

当前的pytorch版本支持的CUDA的算力为3.7、5.0、6.0、7.0

解决办法

我安装的cuda是11.3,对应的pytorch版本为1.10.1,但是为了跑这个代码,我又安装了pytorch1.10,这就导致了CUDA和pytorch版本不一致
因此我重新安装cuda11.1,然后在pytorch官网找到对应的pytorch1.10的安装语句

pip install torch==1.10.0+cpu torchvision==0.11.0+cpu torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html

现在风扇已经在转了!

pytorch官网 链接: https://pytorch.org/get-started/previous-versions/

参考博客

深度学习环境配置避坑: https://blog.csdn.net/weixin_46065198/article/details/125642546

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值