运行报错: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
一般在报错代码行加入参数map_location=torch.device(‘cpu’)即可规避此问题。
父主题:
FAQ