NVlabs / imaginaire

NVIDIA's Deep Imagination Team's PyTorch Library
Other
4k stars 448 forks source link

fs-vid2vid:Failed to load pretrained model #138

Closed xiao-keeplearning closed 2 years ago

xiao-keeplearning commented 2 years ago

Thank for your great work! I try to run inference.py, the pretrained fs-vid2vid model epoch_00200_iteration_000005800_checkpoint.pt cannot be loaded. Program throws exception while loading model:

Traceback (most recent call last):
  File "inference.py", line 95, in <module>
    main()
  File "inference.py", line 86, in main
    trainer.load_checkpoint(cfg, args.checkpoint)
  File "/home/*/imaginaire/imaginaire/trainers/base.py", line 281, in load_checkpoint
    checkpoint_path, map_location=lambda storage, loc: storage)
  File "/home/*/lib/python3.6/site-packages/torch/serialization.py", line 585, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/*/lib/python3.6/site-packages/torch/serialization.py", line 740, in _legacy_load
    return legacy_load(f)
  File "/home/*/lib/python3.6/site-packages/torch/serialization.py", line 665, in legacy_load
    tar.extract('storages', path=tmpdir)
  File "/home/*/lib/python3.6/tarfile.py", line 2043, in extract
    tarinfo = self.getmember(member)
  File "/home/*/lib/python3.6/tarfile.py", line 1754, in getmember
    raise KeyError("filename %r not found" % name)
KeyError: "filename 'storages' not found"

I have confirmed that the model file is downloaded completely, Is it possible that the model file was corrupted? Could you help me solve this problem?

EricHuiK commented 2 years ago

epoch_00200_iteration_000005800_checkpoint.pt this model place in imaginaire/third_party/flow_net/flow_net.py line 29,change your path

xiao-keeplearning commented 2 years ago

@EricHuiK Thanks for your suggestion. However, I'm sure that the program load flowNet checkpoint normally.
The Program throws exception in this line, https://github.com/NVlabs/imaginaire/blob/c6f74845c699c58975fd12b778c375b72eb00e8d/inference.py#L85

And, I try to do small test that only loading epoch_00200_iteration_000005800_checkpoint.pt, it still doesn't work.

SaharHusseini commented 2 years ago

HEllo @xiao-keeplearning. Did you manage to solve your issue? I have a similar problem.