问题背景: 解决办法: 修改前 torch.load(’./checkpoint.pth.tar’) 修改后 torch.load(’./checkpoint.pth.tar’,map_location=“cpu”)