Pytorch错误:Torch not compiled with CUDA enabled

这个原因是pytorch不支持CUDA,

可以先输入

import torch

print(torch.cuda.is_available())

如果输入为false则打开cmd,输入nvidia-smi查看cuda的版本,之后去Previous PyTorch Versions | PyTorch找符合自己cuda的下载方式,重新下载一遍即可