On a cpu device, how to load checkpoint saved on gpu device

I’m sorry, my bad. This should work:

torch.load('my_file.pt', map_location=lambda storage, loc: storage)
47 Likes