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
Uh oh!
There was an error while loading. Please reload this page.
-
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.pmaptf.data.TFRecordDatasetis used for efficient data loadingoptaxis used for optimizationLowlights
flax.optim.DynamicScaleand 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