I’m trying to load a GPU-trained model onto a CPU with the code you suggested:
torch.load('my_file.pt', map_location=lambda storage, location: 'cpu')

… and I get this error:
Traceback (most recent call last):
  File "net_predict.py", line 146, in <module>
    net = torch.load(f_net, map_location=(lambda storage, location: 'cpu'))
  File "/home/[...]/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 248, in load
    return _load(f, map_location, pickle_module)
  File "/home/[...]/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 340, in _load
    tensor = tensor_type._new_with_metadata_file(f, storage)
AttributeError: type object 'str' has no attribute '_new_with_metadata_file'

(I replaced my username with […])
Any idea what I’m doing wrong?