nerdyrodent / VQGAN-CLIP

Just playing with getting VQGAN+CLIP running locally, rather than having to use colab.
Other
2.59k stars 427 forks source link

Face models not working (FFHQ, FacesHQ) #106

Open HylisWilk opened 2 years ago

HylisWilk commented 2 years ago

Is anyone able to use these 2 models? I can't load them no matter what I try. Latest error I'm getting is:

KeyError: 'Expected keytargetto instantiate.'

From ffhq.

If anyone is able to run these models please let me know how.

GucciFlipFlops1917 commented 2 years ago

I had the same issue for a range of different models. It was driving me crazy. The issue is the difference between the official python pip package for taming-transformers and the github repo. It's solved by installing the github version.

pip install transformers
pip uninstall taming-transformers
pip install git+https://github.com/CompVis/taming-transformers

This should work for: Ade20k CelebAHQ Cin Coco Drin FacesHQ FFHQ Gumbel Imagenet_1024 Imagenet_16384 SFlckr Wikiart

GucciFlipFlops1917 commented 2 years ago

Addendum: If any of the models say they can't locate logs/something/last.ckpt, just edit the corresponding yaml file to alter this to the location of where you have your checkpoint file installed.

aliozcan commented 2 years ago

How do you change the model you want to use? I downloaded faceshq for instance with download_models.sh . I tried running generate.py with -m faceshq but it complains that the available models are models = ['RN50', 'RN101', 'RN50x4', 'RN50x16', 'ViT-B/32', 'ViT-B/16'].

GucciFlipFlops1917 commented 2 years ago

@aliozcan That command isn't for the checkpoints files. If you would like to run the faceshq set for instance, you would use python generate.py -p --vqgan_config checkpoints/faceshq.yaml --vqgan_checkpoint checkpoints/faceshq.ckpt But this depends on a few things:

Just like I stated in my addendum, if you receive an issue saying the .ckpt file can't be located, edit the yaml file in a text editor. Alter the existing path for the checkpoint/.ckpt file into where you have it installed.

aliozcan commented 2 years ago

@GucciFlipFlops1917 worked like a charm. Thanks.