Error using torch.load on update

I recently updated from pytorch 0.1.8 to 0.1.10 and I now get the following somewhat confusing error when I try to call torch.load on a file serialized with 0.1.8:

----> 1 a = torch.load("file.pth7")

/usr/local/lib/python2.7/dist-packages/torch/serialization.pyc in load(f, map_location, pickle_module)
    220         f = open(f, 'rb')
    221     try:
--> 222         return _load(f, map_location, pickle_module)
    223     finally:
    224         if new_fd:

/usr/local/lib/python2.7/dist-packages/torch/serialization.pyc in _load(f, map_location, pickle_module)
    353     # try the legacy loader first, which only works if f is a tarfile
    354     try:
--> 355         return legacy_load(f)
    356     except tarfile.TarError:
    357         pass

/usr/local/lib/python2.7/dist-packages/torch/serialization.pyc in legacy_load(f)
    297                     args = pickle_module.load(f)
    298                     key, location, storage_type = args
--> 299                     obj = storage_type._new_with_file(f)
    300                     obj = restore_location(obj, location)
    301                     deserialized_objects[key] = obj

RuntimeError: Success

Huh, that’s surprising. No idea what could have caused that at the moment.

I encounter a similar problem with the version ‘0.1.10+ac9245a’ only.
I save my checkpoint using :

            'epoch': epoch + 1,
            'arch': options['model']['arch'],
            'state_dict': model.state_dict(),
            'best_prec1': best_prec1,
        }, is_best)

But when I try to load it with:


I get this error:

 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/cadene/anaconda3/envs/vqa/lib/python3.6/site-packages/torch/", line 222, in load
    return _load(f, map_location, pickle_module)
  File "/home/cadene/anaconda3/envs/vqa/lib/python3.6/site-packages/torch/", line 377, in _load
    deserialized_objects[key]._set_from_file(f, offset)
RuntimeError: Success

It could be due to the fact that the data in my state_dict are of type torch.cuda.FloatTensor.