1、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.
解决方案:
在./site-package/torch/serialization.py中
def load(f, map_location='cpu', pickle_module=pickle, **pickle_load_args):
替代
def load(f, map_location=None, pickle_module=pickle, **pickle_load_args):
这样就只能CPU训练了。