BEGAN-tensorflow icon indicating copy to clipboard operation
BEGAN-tensorflow copied to clipboard

Unable to reproduce results: Generator output has only two face types

Open ProgramItUp opened this issue 7 years ago • 6 comments

Anyone else having trouble training and reproducing example results for CelebA dataset?

After training on the CelebA dataset for 500,000 iterations, or about 33 hours, with the default settings, I had a look at the output and noticed something odd. The generated images, *_G.png, and fake images, fake.png, have only two face types in each file. Between files they were different, but in each file there are always just two distinct faces.

The same problem occurs in the interpolation tests. The output from setting --is_train=False has the same problem same problem and tries to interpolate between two distinct faces: python main.py --dataset=CelebA --load_path=CelebA_0625_080047 --use_gpu=True --is_train=False --split valid

  1. Is this an example of mode collapse?
  2. Is this a bug or incorrect parameter defaults?
  3. Has anyone been able to reproduce the results on the README?

ProgramItUp avatar Jun 26 '17 21:06 ProgramItUp

I recommend you to adopt fwiffo's advice: change --d_lr to 0.00004, change --g_lr to 0.00004, reduce --lr_update_step, (you can also set --batch_size to 4 for faster training.)

see: https://github.com/carpedm20/BEGAN-tensorflow/issues/1

emc2-2022 avatar Jul 21 '17 01:07 emc2-2022

@Tony-Chiong : Thank you for the clear advice, it really helped. The CelebA dataset is working much better!

For a different dataset with only a few thousand images I set d_lr and g_lr = 0.00004, and even as low as 0.00001. The first 20k to 50k iterations all of the output image types real, fake and generated progress nicely and show steady improvement. After about 100k iterations the fake and generated images look much worse than at 50k iterations and and have gone into mode collapse. The real images continue to improve and capture details in the original data.

Does it sound like the learning rate for the generator not changing fast enough? Thoughts welcomed.

ProgramItUp avatar Jul 23 '17 01:07 ProgramItUp

I meet the same problem use default config and train a set of bag images. I can only see 2 types bags in G.png. there are not diversified.

civilman628 avatar Sep 11 '17 17:09 civilman628

Similar problem occurs when trained with CelebA dataset. I have trained it for 500k iterations and before 410k iterations, everything looks fine but soon mode collapse problem occurs. Only three types of face images are shown in a batch (16) of images.

henrych4 avatar Oct 10 '17 14:10 henrych4

When I look through the source code, I notice that "z" , the input of "Generator", doesn't change during training process. Maybe this results mode collapse. You can check it.

duduheihei avatar Nov 27 '17 08:11 duduheihei

@duduheihei The z input does change. tf.random_normal changes every time sess.run is called (https://github.com/carpedm20/BEGAN-tensorflow/blob/master/trainer.py#L143).

zacharynevin avatar Apr 04 '18 18:04 zacharynevin