labmlai / annotated_deep_learning_paper_implementations

🧑‍🏫 60+ Implementations/tutorials of deep learning papers with side-by-side notes 📝; including transformers (original, xl, switch, feedback, vit, ...), optimizers (adam, adabelief, sophia, ...), gans(cyclegan, stylegan2, ...), 🎮 reinforcement learning (ppo, dqn), capsnet, distillation, ... 🧠
https://nn.labml.ai
MIT License
55.71k stars 5.73k forks source link

[BUG] StyleGAN2: latent vector is ignored #107

Open karray opened 2 years ago

karray commented 2 years ago

The implementation of StyleGAN2 does not learn a mapping for the latent vector z. The vector z is completely ignored, and a variety of generated images is provided by noise. To demonstrate the issue, I created a google colab with a pre-trained model that I trained for 55400 iterations.

Images genertd with a random z and a fixed noise: image

Images generated with a fixed z and random noise image

vpj commented 2 years ago

Thanks. Will look into it.

Siimarras commented 1 year ago

False or Weakening. Ignore or Endure

lukaboljevic commented 1 year ago

Sorry for commenting on a rather old issue, but I've recently implemented StyleGAN2 (being helped by the code from this repository too) and experienced a similar issue - however, in my case, it wasn't due to z or noise.

My models were actually experiencing mode collapse, and no matter what the input was, a pretrained model would always generate the same image. I managed to overcome this issue by playing around with the learning rates and number of gradient accumulation steps.