报错:RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at /pytorch/aten/src/
no CUDA-capable device ,可能原因时没有torch-GPU在代码中指定了GPU(多卡情况下),而单卡中是 ‘0’os.environ["CUDA_VISIBLE_DEVICES"] = '1'将os.environ[“CUDA_VISIBLE_DEVICES”] = ‘1’ 修改为os.environ["CUDA_VISIBLE_DEVICES"] = '0'或者注释该行代码
·
-
no CUDA-capable device ,可能原因时没有torch-GPU
-
在代码中指定了GPU(多卡情况下),而单卡中是 ‘0’
os.environ["CUDA_VISIBLE_DEVICES"] = '1'
将 os.environ[“CUDA_VISIBLE_DEVICES”] = ‘1’ 修改为
os.environ["CUDA_VISIBLE_DEVICES"] = '0'
或者注释该行代码
- 最后,附上pytorch自查代码:
import torch
import torchvision
print(torch.__version__)
print(torch.cuda.is_available())
print(torch.cuda.device_count())
print(torch.cuda.get_device_name())
print(torch.cuda.current_device())
更多推荐

所有评论(0)