In tf.summary.image, max_outputs=3. I want to visualize the output of a convolution layer where max_output is 100. In this case tf.summary.image is not working. Please suggest how can I visualize all feature maps(=100)?
Code snippet
conv2
with tf.variable_scope('conv2') as scope:
kernel2 = _variable_with_weight_decay('weights', shape=[5, 5, 100, 120], stddev=1e-4, wd=0.0)
conv2 = tf.nn.conv2d(norm1, kernel2, [1, 1, 1, 1], padding='SAME')
biases2 = _variable_on_cpu('biases', [120], tf.constant_initializer(0.1))
bias2 = tf.nn.bias_add(conv2, biases2)
conv2 = tf.nn.relu(bias2, name=scope.name)
print(tf.abs(conv2))
_activation_summary(conv2)
tf.summary.image('conv2', conv2, max_outputs=3)
Traceback
tf.summary.image('conv2', conv2, max_outputs=3)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/tensorflow/python/summary/summary.py", line 146, in image
tag=tag, tensor=tensor, max_images=max_outputs, name=scope)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 388, in image_summary
bad_color=bad_color, name=name)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 454, in new_func
return func(*args, **kwargs)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3155, in create_op
op_def=op_def)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1717, in __init__
self._traceback = tf_stack.extract_stack()
InvalidArgumentError (see above for traceback): Tensor must be 4-D with last dim 1, 3, or 4, not [5,100,100,120]
[[Node: tower_3/conv2/conv2_1 = ImageSummary[T=DT_FLOAT, bad_color=Tensor<type: uint8 shape: [4] values: 255 0 0...>, max_images=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](tower_3/conv2/conv2_1/tag, tower_3/conv2/conv2-0-1-TransposeNCHWToNHWC-LayoutOptimizer/_1787)]]
[[Node: tower_1/gradients/tower_1/deconv8/deconv8/BiasAdd_grad/BiasAddGrad/_2204 = _Send[T=DT_FLOAT, client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:1", send_device_incarnation=1, tensor_name="edge_2343_tower_1/gradients/tower_1/deconv8/deconv8/BiasAdd_grad/BiasAddGrad", _device="/job:localhost/replica:0/task:0/device:GPU:1"](tower_1/gradients/tower_1/deconv8/deconv8/BiasAdd_grad/BiasAddGrad)]]
Any type of help will be highly appreciated.