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

Unable to do inference. Missing keys. #6

Open
RahulBhalley opened this issue Jan 3, 2024 · 0 comments
Open

Unable to do inference. Missing keys. #6

RahulBhalley opened this issue Jan 3, 2024 · 0 comments

Comments

@RahulBhalley
Copy link

For following bash command

stylegan2_ckpt=checkpoint/stylegan2-ffhq-config-f.pt

truncation=0.8
sample=1
pics=20
alpha=0.25
seed=42
att_start=0
att_layer=18
att_channel=18

for edit in blond_hair
do
  for mask_thresh in 0.8
  do
    for train_iter in 01000 #02000 05000
    do
      python3 generate.py --ckpt $stylegan2_ckpt --truncation $truncation --sample $sample --pics $pics --alpha $alpha --seed $seed --mask_threshold $mask_thresh --train_iter $train_iter --clip_text $edit --att_layer $att_layer --att_start $att_start --att_channel $att_channel
    done
  done
done

I get missing keys errors.

size 1024 latent 512 n_mlp 8 channel_multiplier 2
Traceback (most recent call last):
  File "/kaggle/working/GanVinci/generate.py", line 192, in <module>
    feat.load_state_dict(feat_checkpoint["weights"])
  File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2041, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for FEAT:
	Missing key(s) in state_dict: "mapper.20.weight", "mapper.20.bias", "mapper.21.weight", "mapper.21.bias", "mapper.22.weight", "mapper.22.bias", "mapper.23.weight", "mapper.23.bias", "mapper.24.weight", "mapper.24.bias", "mapper.25.weight", "mapper.25.bias", "mapper.26.weight", "mapper.26.bias", "mapper.27.weight", "mapper.27.bias", "mapper.28.weight", "mapper.28.bias", "mapper.29.weight", "mapper.29.bias", "mapper.30.weight", "mapper.30.bias", "mapper.31.weight", "mapper.31.bias", "mapper.32.weight", "mapper.32.bias", "mapper.33.weight", "mapper.33.bias", "mapper.34.weight", "mapper.34.bias", "mapper.35.weight", "mapper.35.bias".

How to set the argument values for each of the pre-trained models you've shared?
It seems attn_ prefixed arguments have something to do with these but I don't understand how.

Please help.

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

1 participant