title: Visualizing output of convolutional layer in tensorflow
body: <p>I'm trying to visualize the output of a convolutional layer in tensorflow using the function <code>tf.image_summary</code>. I'm already using it successfully in other instances (e. g. visualizing the input image), but have some difficulties reshaping the output here correctly. I have the following conv layer:</p>
  
  <pre class="lang-py prettyprint-override"><code>img_size = 256
  x_image = tf.reshape(x, [-1,img_size, img_size,1], "sketch_image")
  
  W_conv1 = weight_variable([5, 5, 1, 32])
  b_conv1 = bias_variable([32])
  
  h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)
  </code></pre>
  
  <p>So the output of <code>h_conv1</code> would have the shape <code>[-1, img_size, img_size, 32]</code>. Just using <code>tf.image_summary("first_conv", tf.reshape(h_conv1, [-1, img_size, img_size, 1]))</code> Doesn't account for the 32 different kernels, so I'm basically slicing through different feature maps here.</p>
  
  <p>How can I reshape them correctly? Or is there another helper function I could use for including this output in the summary?</p>