using my own pretrained stylegan2 network #35

Closed
opened 2026-01-29 21:38:41 +00:00 by claunia · 5 comments
Owner

Originally created by @MDYLL on GitHub (Jul 27, 2021).

Hello :)
Thank you very much for your repo. I got a lot of beatiful photos. :))))

I try to use my own pretrained stylegan from official repo
https://github.com/NVlabs/stylegan2

But I cannot understand how I should use pkl-file, that I have.

I convert it to pt-file by
https://github.com/dvschultz/ai/blob/master/Convert_pkl_to_pt.ipynb
and change yml:
decoder_load_path: experiments/pretrained_models/stylegan2-ffhq-config-f.pt
but got error:
KeyError: 'params_ema'

May be I should use another repo for getting correct pth-file for decoder ?

Thank you :)))

Originally created by @MDYLL on GitHub (Jul 27, 2021). Hello :) Thank you very much for your repo. I got a lot of beatiful photos. :)))) I try to use my own pretrained stylegan from official repo https://github.com/NVlabs/stylegan2 But I cannot understand how I should use pkl-file, that I have. I convert it to pt-file by https://github.com/dvschultz/ai/blob/master/Convert_pkl_to_pt.ipynb and change yml: decoder_load_path: experiments/pretrained_models/stylegan2-ffhq-config-f.pt but got error: KeyError: 'params_ema' May be I should use another repo for getting correct pth-file for decoder ? Thank you :)))
Author
Owner

@MDYLL commented on GitHub (Jul 29, 2021):

done:

https://github.com/xinntao/BasicSR/blob/master/docs/HOWTOs.md#How-to-train-StyleGAN2

  1. dataset should contain 70K images
  2. change yml:

network structures

network_g:
channel_multiplier:1

network_g:
channel_multiplier:1

you will get pth file for GFPGAN

@MDYLL commented on GitHub (Jul 29, 2021): done: https://github.com/xinntao/BasicSR/blob/master/docs/HOWTOs.md#How-to-train-StyleGAN2 1. dataset should contain 70K images 2. change yml: # network structures network_g: channel_multiplier:1 network_g: channel_multiplier:1 you will get pth file for GFPGAN
Author
Owner

@yx-chan131 commented on GitHub (Dec 1, 2021):

Hi, @MDYLL , so you train a new StyleGAN2 model using BasicSR library?
May I know how long is the duration for training?

@yx-chan131 commented on GitHub (Dec 1, 2021): Hi, @MDYLL , so you train a new StyleGAN2 model using BasicSR library? May I know how long is the duration for training?
Author
Owner

@MDYLL commented on GitHub (Dec 1, 2021):

I think it depends on GPU. In my case it took 3 days. And after I could inference GFPGAN on CPU

@MDYLL commented on GitHub (Dec 1, 2021): I think it depends on GPU. In my case it took 3 days. And after I could inference GFPGAN on CPU
Author
Owner

@yx-chan131 commented on GitHub (Dec 2, 2021):

@MDYLL Thanks for your reply. May I know whether you turn off the generator regularization when training styleGAN2? Because I found that this is the problem that cause my training speed to be extremely slow.

@yx-chan131 commented on GitHub (Dec 2, 2021): @MDYLL Thanks for your reply. May I know whether you turn off the generator regularization when training styleGAN2? Because I found that this is the problem that cause my training speed to be extremely slow.
Author
Owner

@MDYLL commented on GitHub (Dec 2, 2021):

:)
Nope. Train parameters have been set by default

@MDYLL commented on GitHub (Dec 2, 2021): :) Nope. Train parameters have been set by default
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#35