RuntimeError: CUDA error: invalid device ordinal CUDA kernel errors might be asynchronously reported

在这里插入图片描述


问题描述:

在运行代码 args.device = torch.device('cuda: ' + str(args.gpu_id)) 设置GPU时出现如下问题 RuntimeError: CUDA error: invalid device ordinal CUDA kernel errors might be asynchronously reported

RuntimeError: CUDA error: 
invalid device ordinal CUDA kernel errors might be asynchronously reported at some other api call,
so the stacktrace below might be incorrect. 
for debugging cons

猜你喜欢

转载自blog.csdn.net/m0_47256162/article/details/132575426