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