出现错误(已解决)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 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的安裝語句
現在風扇已經在轉了!
pytorch官網 鏈接: https://pytorch.org/get-started/previous-versions/
參考博客
深度學習環境配置避坑: https://blog.csdn.net/weixin_46065198/article/details/125642546
總結
以上是生活随笔為你收集整理的出现错误(已解决)RuntimeError: CUDA error: no kernel image is available for execution on the device CUDA ker的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2021江苏地区高考成绩排名查询,江苏高
- 下一篇: 学习lumberjack framewo