1.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.
原因:当前电脑GPU算力与当前环境下pytorch中的cuda算力不匹配
解决:当前shell下执行:
export TORCH_CUDA_ARCH_LIST="8.0" # 数值匹配于cuda版本
ps:torch常用命令:
python
import torch
torch.__version__
torch.cuda.is_availabel()
torch.cuda.get_device_capability()