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 zip archive: not a ZIP archive #67

Open
and-human opened this issue Jul 15, 2024 · 5 comments

Comments

@and-human
Copy link

and-human commented Jul 15, 2024

I was trying to replicate pix2pix turbo training using the dataset given on the training page but end up getting this error again and again.

Device: ubuntu 22.04 server
GPU: RTX A5000

Error:

Steps: 0%| | 0/10000 [00:00<?, ?it/s]Traceback (most recent call last):
File "/home/anshuman/img2img-turbo/src/train_pix2pix_turbo.py", line 307, in
main(args)
File "/home/anshuman/img2img-turbo/src/train_pix2pix_turbo.py", line 154, in main
feat_model = build_feature_extractor("clean", "cuda", use_dataparallel=False)
File "/home/anshuman/img2img-turbo/venv/lib/python3.10/site-packages/cleanfid/features.py", line 46, in build_feature_extractor
feat_model = feature_extractor(name="torchscript_inception", resize_inside=False, device=device, use_dataparallel=use_dataparallel)
File "/home/anshuman/img2img-turbo/venv/lib/python3.10/site-packages/cleanfid/features.py", line 21, in feature_extractor
model = InceptionV3W(path, download=True, resize_inside=resize_inside).to(device)
File "/home/anshuman/img2img-turbo/venv/lib/python3.10/site-packages/cleanfid/inception_torchscript.py", line 35, in init
self.base = torch.jit.load(path).eval()
File "/home/anshuman/img2img-turbo/venv/lib/python3.10/site-packages/torch/jit/_serialization.py", line 162, in load
cpp_module = torch._C.import_ir_module(cu, str(f), map_location, _extra_files, _restore_shapes) # type: ignore[call-arg]
RuntimeError: PytorchStreamReader failed reading zip archive: not a ZIP archive

@GaParmar
Copy link
Owner

This typically happens when the InceptionV3 file did not get downloaded completely.
Can you run this command to check if you get any error?

from cleanfid.fid import build_feature_extractor
feat_model = feature_extractor(name="torchscript_inception", resize_inside=False, device=device, use_dataparallel=Falsel)

-Gaurav

@and-human
Copy link
Author

The above script required me to install a lot of dependencies. After installing them and changing feature_extractor to build_feature_extractor, I got unexpected keyword errors for resize_inside and use_dataparallel. After removing those and changing device to "cuda" I get following errors:

in python 3.12 - RuntimeError: PytorchStreamReader failed reading zip archive: not a ZIP archive
in python 3.11 - TypeError: build_feature_extractor() got an unexpected keyword argument 'name'

@YijiFeng
Copy link

Oh, I meet the same problem, that confused me a lot !!!

@YijiFeng
Copy link

This typically happens when the InceptionV3 file did not get downloaded completely. Can you run this command to check if you get any error?

from cleanfid.fid import build_feature_extractor
feat_model = feature_extractor(name="torchscript_inception", resize_inside=False, device=device, use_dataparallel=Falsel)

-Gaurav

I have tried this solution,but I got the same problem. It can not solve the problem.
Uploading 截图 2024-09-26 16-47-50.png…

@GaParmar
Copy link
Owner

Oh I apologize, I had a typo in the above command. @YijiFeng @and-human
Could you try this command below instead to see if you downloaded the clean-fid weights correctly:

from cleanfid.fid import build_feature_extractor
f = build_feature_extractor("clean", "cuda", use_dataparallel=False)

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

3 participants