0

I am building a GAN (Generative Adversarial Network). I need to use tf.nn.conv2d, but it does not work properly. Instead tf.layers.conv2d works fine, it generates images since iteration 300. The network with tf.nn only produces noise.

is there a difference that i'm missing?

conv = tf.layers.conv2d(input_layer, filters=128, kernel_size=5, strides=2, padding="same",kernel_initializer=tf.random_normal_initializer(stddev=0.02), activation=None, use_bias=False)

vs

w0 = tf.get_variable('w0', initializer=tf.random_normal_initializer(stddev=0.02), shape=[5, 5, 3, 128])
conv = tf.nn.conv2d(input_layer, w0, strides=[1, 2, 2, 1], padding="SAME")
  • 2
    Possible duplicate of [tf.nn.conv2d vs tf.layers.conv2d](https://stackoverflow.com/questions/42785026/tf-nn-conv2d-vs-tf-layers-conv2d) – Mihail Burduja Nov 14 '17 at 20:18
  • I've already read that answer, but i'm pretty sure that tf.nn.conv2d does not work exactly the same as tf.layers.conv2d for my case. And based on the params given, it should. – jmesuro Nov 18 '17 at 05:20

0 Answers0