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

Face models not working (FFHQ, FacesHQ) #106

Open
HylisWilk opened this issue Dec 28, 2021 · 5 comments
Open

Face models not working (FFHQ, FacesHQ) #106

HylisWilk opened this issue Dec 28, 2021 · 5 comments

Comments

@HylisWilk
Copy link

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 key target to instantiate.'

From ffhq.

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

@GucciFlipFlops1917
Copy link

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
Copy link

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
Copy link

aliozcan commented Jan 5, 2022

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
Copy link

GucciFlipFlops1917 commented Jan 5, 2022

@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:

  • Where you have the .yaml and .ckpt files
  • What you named the .yaml and .ckpt files
  • If the YAML file references a different location for the checkpoint file

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
Copy link

aliozcan commented Jan 5, 2022

@GucciFlipFlops1917 worked like a charm. Thanks.

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