mfrashad / text2art

AI-powered Text-to-Art Generator - Text2Art.com
Other
778 stars 208 forks source link

PytorchStremReader failed reading zip archive #12

Open MarnoJacobs13 opened 2 years ago

MarnoJacobs13 commented 2 years ago

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 commented 2 years ago

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

schigrinov commented 2 years ago

@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 commented 2 years ago

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.