I have train my data with cnn model and shuffle images. The first convolution layer is defined:
with tf.name_scope("conv1") as scope:
image = tf.placeholder(tf.float32, [FLAGS.batch_size, 32, 32, 1])
image = tf.reshape(image, [FLAGS.batch_size, 32, 32, 1])
print(image)
w_conv1 = weight_variable([7, 7, 1, 50])
tf.summary.histogram('w_conv1', w_conv1)
conv = tf.nn.conv2d(image, w_conv1, [1, 1, 1, 1], padding='SAME')
b_conv1 = bias_variable([50])
tf.summary.histogram('b_conv1', b_conv1)
conv1 = tf.nn.bias_add(conv, b_conv1)
tf.summary.image('conv1_img',conv1)# **this line get the error**
print('conv1:')
print(conv1)
if I remove the line" tf.summary.image('conv1_img',conv1)", program can run successfully. When I add this line ,the error:
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed avalue for placeholder tensor 'conv1/Placeholder' with dtype float and shape [30,32,32,1]
happens,why?