现象:RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
图片:
如果你想在 CPU 上运行模型,需要确保将模型加载到 CPU 中,
model = torch.load(PATH, map_location=torch.device('cpu'))