Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: pretrained model #11

Open
Hepecho opened this issue May 20, 2023 · 7 comments
Open

Error: pretrained model #11

Hepecho opened this issue May 20, 2023 · 7 comments

Comments

@Hepecho
Copy link

Hepecho commented May 20, 2023

Hi, when I tried swap face operation:

python scripts/face_swap.py --source=example/input/faceswap/source.jpg --target=example/input/faceswap/target.jpg

the following error is reported:

Traceback (most recent call last):
  File "scripts/face_swap.py", line 345, in <module>
    generator, kp_detector, he_estimator, estimate_jacobian = init_facevid2vid_pretrained_model(face_vid2vid_cfg, face_vid2vid_ckpt)
  File "/root/project/e4s-main/./src/pretrained/face_vid2vid/driven_demo.py", line 216, in init_facevid2vid_pretrained_model
    generator, kp_detector, he_estimator = load_checkpoints(config_path=cfg_path, checkpoint_path=ckpt_path, gen="spade", cpu=False)
  File "/root/project/e4s-main/./src/pretrained/face_vid2vid/driven_demo.py", line 49, in load_checkpoints
    checkpoint = torch.load(checkpoint_path)
  File "/root/miniconda3/envs/e4s/lib/python3.8/site-packages/torch/serialization.py", line 712, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "/root/miniconda3/envs/e4s/lib/python3.8/site-packages/torch/serialization.py", line 1049, in _load
    result = unpickler.load()
  File "/root/miniconda3/envs/e4s/lib/python3.8/site-packages/torch/serialization.py", line 1019, in persistent_load
    load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))
  File "/root/miniconda3/envs/e4s/lib/python3.8/site-packages/torch/serialization.py", line 997, in load_tensor
    storage = zip_file.get_storage_from_record(name, numel, torch._UntypedStorage).storage()._untyped()
RuntimeError: PytorchStreamReader failed reading file data/94709563812016: invalid header or archive is corrupted

It seems to be related to the pre-trained model 00000189-checkpoint.pth.tar, but I downloaded it from the given link.
Can someone with a similar problem help me out?
Thanks.

@ketakachono
Copy link

bro how did you install this? can you send me a message on telegram? https://t.me/keronikateka or @keronikateka

@e4s2022
Copy link
Owner

e4s2022 commented May 21, 2023

What's the file size? ls pretrained_ckpts/facevid2vid/00000189-checkpoint.pth.tar -l tells me 2112619148. Please try to re-download the file.

@Hepecho
Copy link
Author

Hepecho commented May 21, 2023

What's the file size? ls pretrained_ckpts/facevid2vid/00000189-checkpoint.pth.tar -l tells me 2112619148. Please try to re-download the file.

ls pretrained_ckpts/facevid2vid/00000189-checkpoint.pth.tar -l

Here is the result:

-rwxr-xr-x 1 root root 2112619148 May 20 23:28 pretrained_ckpts/facevid2vid/00000189-checkpoint.pth.tar

I also tried to re-download the file and checked its MD5 before and after re-downloading and it was all 0dbdf37f02a3e7ed2115ddee8789b33a.

@Hepecho
Copy link
Author

Hepecho commented May 21, 2023

bro how did you install this? can you send me a message on telegram? https://t.me/keronikateka or @keronikateka

Sorry, but I haven't managed to configure the environment yet either :(

@ketakachono
Copy link

bro how did you install this? can you send me a message on telegram? https://t.me/keronikateka or @keronikateka

Sorry, but I haven't managed to configure the environment yet either :(

Hopefully he makes a dockerfile for it, I hope he doesnt ignore these messages cause seems like nobody has managed to make it work so far but him

@e4s2022
Copy link
Owner

e4s2022 commented May 22, 2023

@Hepecho, I tested a new env in a clean machine just now and followed the installation guide step by step. It works well for me. I think re-download the file works would solve the problem.

@zsf882299
Copy link

hi, @Hepecho , the weight link of 00000189-checkpoint.pth.tar in the facevid2vid paper is gone,can you send me a copy one? thank you very much! my email is 13521608297@163.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants