I’ve also encountered this error when trying to restore a large seq2seq model on a CPU machine after moving it from GPU.
RuntimeError                              Traceback (most recent call last)
 in ()
4 encoder, decoder = init_encoder_decoder(CCO_KMER_VOCAB_SZ, CCO_GO_VOCAB_SZ)
5
----> 6 encoder, decoder, _ = load_encoder_decoder_weights(encoder, decoder, “/tmp/seq2go-CCO-latest.tar”)
 in load_encoder_decoder_weights(encoder, decoder, resume_path)
20     if os.path.isfile(resume_path):
21         print("=> loading checkpoint ‘%s’" % resume_path)
—> 22         checkpoint = torch.load(resume_path, map_location=lambda storage, loc: storage)
23         epoch = checkpoint[‘epoch’]
24         encoder.load_state_dict(checkpoint[‘encoder’])
~/development/prot2vec/virtualenv/lib/python3.6/site-packages/torch/serialization.py in load(f, map_location, pickle_module)
229         f = open(f, ‘rb’)
230     try:
–> 231         return _load(f, map_location, pickle_module)
232     finally:
233         if new_fd:
~/development/prot2vec/virtualenv/lib/python3.6/site-packages/torch/serialization.py in _load(f, map_location, pickle_module)
384     for key in deserialized_storage_keys:
385         assert key in deserialized_objects
–> 386         deserialized_objects[key]._set_from_file(f, offset)
387         offset = None
388
RuntimeError: storage has wrong size: expected -5162093521787232627 got 1194000