mirror of
https://github.com/TencentARC/GFPGAN.git
synced 2026-02-15 05:44:38 +00:00
RuntimeError: Error(s) in loading state_dict for GFPGANv1: #71
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ntquyen11 on GitHub (Sep 17, 2021).
I train the model on my own dataset. However, when I inference image, the error happens and I don't know the reason for this

@jcn16 commented on GitHub (Sep 21, 2021):
similar problem. The pretrained StyleGAN2 has size mismatch problem.
@jcn16 commented on GitHub (Sep 21, 2021):
you can extract pretrained StyleGAN2 from the given checkpoint, which works for me.
@ntquyen11 commented on GitHub (Sep 22, 2021):
Thanks for your response. I fixed this p
@xinntao commented on GitHub (Sep 23, 2021):
It seems that the loaded model has a mismatched size from your configuration.
You may need to update the configuration.
If you need the corresponding pre-trained model, please let me know, I will upload it.
@jcn16 commented on GitHub (Sep 23, 2021):
To kown the reason, you can print the dict keys of GFPGANCleanv1-NoCE-C2.pth and StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth. The names of styleGAN mlp layer are different.
Simply changing the keys can solve the mismatch problem
@xinntao commented on GitHub (Sep 23, 2021):
GFPGANCleanv1-NoCE-C2.pth uses a different network from StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth.
We have not upload the whole training process and pre-trained models for GFPGANCleanv1-NoCE-C2.pth
@ntquyen11 commented on GitHub (Sep 27, 2021):
yup. I have to change channel = 1 instead of channel = 2 and arch = None when using my model. Thanks for your response