Hi!
After training and resuming a model many times, I saved the model using:
torch.save({
 'epoch': epoch + 1,
 'state_dict': model.state_dict(),
 'optimizer': optimizer.state_dict(),
 }, 'final_checkpoint.pth')

I use this code to load my model for testing
checkpoint = torch.load('final_checkpoint.pth')
network.load_state_dict(checkpoint['state_dict'])

but it gives me this error
 checkpoint = torch.load('final_checkpoint.pth')
  File "/home/fstu1/miniconda3/lib/python3.6/site-packages/torch/serialization.py", line 358, in load
    return _load(f, map_location, pickle_module)
  File "/home/fstu1/miniconda3/lib/python3.6/site-packages/torch/serialization.py", line 527, in _load
    return legacy_load(f)
  File "/home/fstu1/miniconda3/lib/python3.6/site-packages/torch/serialization.py", line 441, in legacy_load
    tar.extract('storages', path=tmpdir)
  File "/home/fstu1/miniconda3/lib/python3.6/tarfile.py", line 2039, in extract
    tarinfo = self.getmember(member)
  File "/home/fstu1/miniconda3/lib/python3.6/tarfile.py", line 1750, in getmember
    raise KeyError("filename %r not found" % name)
KeyError: "filename 'storages' not found"

I don’t really know what is the problem, any help will be appreciated. Thanks.