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.
torch版本不匹配
1.卸载torch
2.安装相应版本
3.测试:
torch.cuda.is_available() 只是检测CUDA是否安装正确并能被Pytorch检测到
a=torch.Tensor([1,2])
a=a.cuda()
a
本文档介绍了如何解决CUDA错误'no kernel image is available for execution on the device',该错误通常由torch版本与CUDA版本不兼容引起。解决步骤包括卸载torch、安装与系统CUDA兼容的torch版本,以及通过简单的代码测试验证CUDA是否可用。确保正确配置CUDA环境对于深度学习项目至关重要。
1092

被折叠的 条评论
为什么被折叠?



