Training StyleGAN2 in Flax #1539
Unanswered
matthias-wright
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
a while ago I posted here about some pretrained models that I ported to Flax. I have now added the training code for StyleGAN2: https://github.com/matthias-wright/flaxmodels/tree/main/training/stylegan2
Highlights
jax.pmap
tf.data.TFRecordDataset
is used for efficient data loadingoptax
is used for optimizationLowlights
flax.optim.DynamicScale
and also all the tricks from the original implementation (casting to float32 for some operations, using pre-normalization in the modulated conv layer, only using float16 for the higher resolutions, clipping the output of the convolution layers, etc) but it is not properly working yet.I also added instructions on how to train on your own dataset. If you have any questions feel free to ask them here or on the github page.
Cheers!
P.S. I also added training code for ResNet and VGG but that is less interesting since there are already some great examples here, which I also borrowed from.
Some results
Style mixing
Beta Was this translation helpful? Give feedback.
All reactions