zyainfal / One-Shot-Face-Swapping-on-Megapixels

One Shot Face Swapping on Megapixels.
Other
314 stars 40 forks source link

Load Pre-trained model Error #21

Open jihyeonRyu opened 2 years ago

jihyeonRyu commented 2 years ago

I got Runtime Error when loading pre-trained model. (./checkpoint/injection_final-002.pth)

  File "inference.py", line 240, in <module>
    handler = MegaFS(args.swap_type, args.img_root, args.mask_root)
  File "inference.py", line 80, in `__init__`
    ckpts = torch.load(ckpt_e, map_location=torch.device("cuda" if torch.cuda.is_available() else "cpu"))
  File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 593, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 780, in _legacy_load
    deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
RuntimeError: storage has wrong size: expected -5248227559754992354 got 512

Please help me....

zyainfal commented 2 years ago

I'm not sure why could this happen. Can you use FTM version of MegaFS?