kozistr / Awesome-GANs

Awesome Generative Adversarial Networks with tensorflow
MIT License
761 stars 163 forks source link

PGGAN generator has some bug? #13

Open kuoluo1995 opened 4 years ago

kuoluo1995 commented 4 years ago

I find PGGAN can not train. When pg ==1, generator make the fake image which shape is [-1,16,16, 3]. And i find reason: because generator has upsample twice on line of block the pggan_model.py . repair

x = block(x, nf(i + 1), name="1")
# x = block(x, nf(i + 1), name="2")
x = tf.layers.conv2d(x, filters=get_out_channels(i + 1), kernel_size=3, strides=1, padding='SAME',
                        kernel_initializer=w_init, kernel_regularizer=w_reg, bias_initializer=b_init,
                        name='gen_n_%s_conv2d-%d' % (name, x.get_shape()[1]))
x = tf.nn.leaky_relu(x)
x = pix_norm(x)
kuoluo1995 commented 4 years ago

And initializer is very important. Your method will be exploding gradients when pg = 6.

kozistr commented 4 years ago

thx for reporting the issue!

some of my implementations are not maintained and there're several issues like PGGAN impl of mine (not perfectly impled) :(

someday, i'll fix the issues as possible as i can. thank you in advance!