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

RuntimeError: PytorchStreamReader failed reading file data/104: invalid header or archive is corrupted #23

Open
fairynn opened this issue Aug 2, 2023 · 3 comments

Comments

@fairynn
Copy link

fairynn commented Aug 2, 2023

when testing the python version Full StyleAvatar pretrained model, I got error as below:
python test.py --render_dir test/render --uv_dir test/uv --ckpt pretrained/lizhen_full_python.pt --save_dir output/test
load model: pretrained/lizhen_full_python.pt
Traceback (most recent call last):
File "test.py", line 56, in
ckpt = torch.load(args.ckpt)
File "/root/miniconda3/envs/styleavatar/lib/python3.8/site-packages/torch/serialization.py", line 809, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/root/miniconda3/envs/styleavatar/lib/python3.8/site-packages/torch/serialization.py", line 1172, in _load
result = unpickler.load()
File "/root/miniconda3/envs/styleavatar/lib/python3.8/site-packages/torch/serialization.py", line 1142, in persistent_load
typed_storage = load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))
File "/root/miniconda3/envs/styleavatar/lib/python3.8/site-packages/torch/serialization.py", line 1112, in load_tensor
storage = zip_file.get_storage_from_record(name, numel, torch.UntypedStorage)._typed_storage()._untyped_storage
RuntimeError: PytorchStreamReader failed reading file data/104: invalid header or archive is corrupted

it seems the model file is corrupted

@LizhenWangT
Copy link
Owner

LizhenWangT commented Aug 2, 2023

Please check if your pt file is fully downloaded and if your pytorch version is 2.0.1. At least two other users besides me have successfully tested this file.

@LizhenWangT
Copy link
Owner

I have tested it again on Pytoch 1.12. It also works.

@fairynn
Copy link
Author

fairynn commented Aug 3, 2023

Thanks for your reply. I will try it again.

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

2 participants