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

PytorchStremReader failed reading zip archive #12

Open
MarnoJacobs13 opened this issue Jan 5, 2022 · 3 comments
Open

PytorchStremReader failed reading zip archive #12

MarnoJacobs13 opened this issue Jan 5, 2022 · 3 comments

Comments

@MarnoJacobs13
Copy link

Hi there

I keep getting this issue when I try and run VQGAN + CLIP



RuntimeError Traceback (most recent call last)
in ()
12 # Apply these settings and run
13 settings = clipit.apply_settings()
---> 14 clipit.do_init(settings)
15 clipit.do_run(settings)

4 frames
/usr/local/lib/python3.7/dist-packages/torch/serialization.py in init(self, name_or_buffer)
240 class _open_zipfile_reader(_opener):
241 def init(self, name_or_buffer) -> None:
--> 242 super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer))
243
244

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

@schigrinov
Copy link

+1 here. I`m getting the same error. Have you managed to fix it?

@schigrinov
Copy link

@mfrashad - thanks for sharing this repo. The post looks great, however, I`m really keen to experiment myself. If you have a moment - can you pls let us know if you are familiar with the above error? It seems like several people are experiencing it, therefore it is likely to help others as well. Appreciate this!
The complete description is below. My guess is that some config files in Vqgan are missing.

RuntimeError Traceback (most recent call last)
in ()
12 # Apply these settings and run
13 settings = clipit.apply_settings()
---> 14 clipit.do_init(settings)
15 clipit.do_run(settings)

4 frames
/content/clipit/clipit.py in do_init(args)
400 else:
401 drawer = VqganDrawer(args.vqgan_model)
--> 402 drawer.load_model(args.vqgan_config, args.vqgan_checkpoint, device)
403 num_resolutions = drawer.get_num_resolutions()
404 # print("-----------> NUMR ", num_resolutions)

/content/clipit/vqgan.py in load_model(self, config_path, checkpoint_path, device)
103 model = vqgan.VQModel(**config.model.params)
104 model.eval().requires_grad_(False)
--> 105 model.init_from_ckpt(checkpoint_path)
106 elif config.model.target == 'taming.models.vqgan.GumbelVQ':
107 model = vqgan.GumbelVQ(**config.model.params)

/content/taming-transformers/taming/models/vqgan.py in init_from_ckpt(self, path, ignore_keys)
43
44 def init_from_ckpt(self, path, ignore_keys=list()):
---> 45 sd = torch.load(path, map_location="cpu")["state_dict"]
46 keys = list(sd.keys())
47 for k in keys:

/usr/local/lib/python3.7/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, **pickle_load_args)
598 # reset back to the original position.
599 orig_position = opened_file.tell()
--> 600 with _open_zipfile_reader(opened_file) as opened_zipfile:
601 if _is_torchscript_zip(opened_zipfile):
602 warnings.warn("'torch.load' received a zip file that looks like a TorchScript archive"

/usr/local/lib/python3.7/dist-packages/torch/serialization.py in init(self, name_or_buffer)
240 class _open_zipfile_reader(_opener):
241 def init(self, name_or_buffer) -> None:
--> 242 super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer))
243
244

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

@MarnoJacobs13
Copy link
Author

I think it has something to do with the ffmpeg-linux64-v3.1.1 file which it downloads initially. I think it is curropt if you do something after running the code. I signed in with a different google account and ran the setup up and the VQGAN + CLIP again and it worked. When I signed in with my normal account the next day it was also working.

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