Closed Gabrielmtn closed 2 years ago
So, I'm trying to replace line 4 with wget https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384/resolve/main/flax_model.msgpack -P ./pretrained/vqgan/
but running into the same issue in Colab.
Updating the huggingface file might do the trick as noted in https://github.com/kuprel/min-dalle/issues/1
Updating the file unfortunately did not work for me.
In Colab, everything is saved under /content/
so the path should be /content/pretrained/vqgan/flax_model.msgpack
.
Thanks for pointing this out. The problem was that the vqgan repository was being cloned to the wrong directory. The updated colab should work now
Just quickly sharing an error output from the collab, impressive project!
FileNotFoundError Traceback (most recent call last) in ()
1 from min_dalle.generate_image import generate_image_from_text
2
----> 3 image = generate_image_from_text("alien life", seed=7)
4 display(image)
2 frames /content/min-dalle/min_dalle/generate_image.py in generate_image_from_text(text, is_mega, is_torch, seed, image_token_count) 72 73 if image_token_count == config['image_length']: ---> 74 image = detokenize_torch(image_tokens) 75 return Image.fromarray(image) 76 else:
/content/min-dalle/min_dalle/min_dalle_torch.py in detokenize_torch(image_tokens) 105 print("detokenizing image") 106 model_path = './pretrained/vqgan' --> 107 params = load_vqgan_torch_params(model_path) 108 detokenizer = VQGanDetokenizer() 109 detokenizer.load_state_dict(params)
/content/min-dalle/min_dalle/load_params.py in load_vqgan_torch_params(path) 8 9 def load_vqgan_torch_params(path: str) -> Dict[str, torch.Tensor]: ---> 10 with open(os.path.join(path, 'flax_model.msgpack'), "rb") as f: 11 params: Dict[str, numpy.ndarray] = serialization.msgpack_restore(f.read()) 12
FileNotFoundError: [Errno 2] No such file or directory: './pretrained/vqgan/flax_model.msgpack'
.pretrained/vqgan/flax_model.msgpack does appear in the filetree
"watch -n 1 nvidia-smi" show I'm on a p100, if that helps.