AssertionError: Torch not compiled with CUDA enabled cpu电脑跑不通下载下来的gpu程序,将GPU运算的代码转为CPU运算,在代码前加 device = torch.device("cuda" if torch.cuda.is_available() else "cpu") 后面的代码需要把 .cuda() 替换成 .to(device) 感谢https://www.cnblogs.com/edkong/p/16028173.html