问题:
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.
解决问题的方法:
torch.load(‘tut1-model.pt’)
改成:
torch.load(‘tut1-model.pt’, map_location=‘cpu’)
please use torch.load with map_location=torch.device(‘cpu‘) to map your storages to the CPU.
最新推荐文章于 2023-08-02 10:51:54 发布