nlintz / TensorFlow-Tutorials

Simple tutorials using Google's TensorFlow Framework
6k stars 1.52k forks source link

11_gan do not work! #83

Open lanpay-lulu opened 7 years ago

lanpay-lulu commented 7 years ago

I try to generate and display a new sample, but generate a array of all 0.5. And I print g_cost = sess.run(G_objective, feed_dict={z: generate_z(batch_size)}) at each iteration but find that they are all the same. I really don`t know where it goes wrong...

lanpay-lulu commented 7 years ago

The problem is here: def xavier_initializer(shape): return tf.random_normal(shape=shape, stddev=1/shape[0])

stddev=1/shape[0] should be stddev=1.0/shape[0]

hunkim commented 7 years ago

Cool. Could you send a pull request?

lanpay-lulu commented 7 years ago

It seems that the output of G for each pixel should be in range [0,255]? Using sigmoid will only generate values in range (0, 1). No significant image has been generated so far. I`m still working on it.