williamyang1991 / DualStyleGAN

[CVPR 2022] Pastiche Master: Exemplar-Based High-Resolution Portrait Style Transfer
Other
1.64k stars 254 forks source link

Error occured when pretraining dualstylegan #86

Closed RewindL closed 1 year ago

RewindL commented 1 year ago

In line 419-422 of pretrain_dualstylegan.py, two load_state_dict operations are executed to load dict of g_optim and d_optim from stylegan2 checkpoint. But I find a problem that g_optim in pretrain_dualstylegan.py contains different parameters from stylegan2 g_optim, and when I ran the code, I met *** ValueError: loaded state dict contains a parameter group that doesn't match the size of optimizer's group and I checked the lengths of parameters which are 74 and 110 respectively. So I have a question that is it reasonable to execute "g_optim.load_state_dict(ckpt["g_optim"])" ? Or there are something I missed or misunderstood ?

williamyang1991 commented 1 year ago

line 419-422 is not used in my case, because my stylegan2 checkpoint (stylegan2-ffhq-config-f.pt) has no g_optim and d_optim.

You can just comment out line 419-422.

RewindL commented 1 year ago

line 419-422 is not used in my case, because my stylegan2 checkpoint (stylegan2-ffhq-config-f.pt) has no g_optim and d_optim.

You can just comment out line 419-422.

OK, thanks for your answer.