When I use
def main_conv_nn(images, training):
# Convolution
convFilterShape = [3, 3, 1, 32]
convFilterWeights = tf.Variable(tf.truncated_normal(convFilterShape, stddev=0.1))
Layer1 = tf.nn.conv2d(images, convFilterWeights, strides= [1,1,1,1] , padding='SAME')
Its performance is under 20% accuracy for MNIST related code. Its performance is really bad.
however when I changed my code like this,
def main_conv_nn(images, training):
# Convolution
#convFilterShape = [3, 3, 1, 32]
#convFilterWeights = tf.Variable(tf.truncated_normal(convFilterShape, stddev=0.1))
#Layer1 = tf.nn.conv2d(images, convFilterWeights, strides= [1,1,1,1] , padding='SAME')
Layer1 = tf.layers.conv2d(images, 32, [5, 5], padding= 'same')
it works perfectly.
WHY tf.nn.conv2d does not work ? (there is no error but works strange)