title: How do I fix a dimension error in TensorFlow?
body: <p>I'm trying to apply the expert portion of the tutorial to my own data but I keep running into dimension errors. Here's the code leading up to the error.</p>
  
  <pre><code>def weight_variable(shape):
      initial = tf.truncated_normal(shape, stddev=0.1)
      return tf.Variable(initial)
  
  def bias_variable(shape):
      initial = tf.constant(0.1, shape=shape)
      return tf.Variable(initial)
  
  def conv2d(x, W):
      return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
  
  def max_pool_2x2(x):
      return tf.nn.max_pool(x, ksize=[1, 2, 2, 1],
                          strides=[1, 2, 2, 1], padding='SAME')
  
  W_conv1 = weight_variable([1, 8, 1, 4])
  b_conv1 = bias_variable([4])
  
  x_image = tf.reshape(tf_in, [-1,2,8,1])
  
  h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)
  h_pool1 = max_pool_2x2(h_conv1)
  </code></pre>
  
  <p>And then when I try to run this command:</p>
  
  <pre><code>W_conv2 = weight_variable([1, 4, 4, 8])
  b_conv2 = bias_variable([8])
  
  h_conv2 = tf.nn.relu(conv2d(h_pool1, W_conv2) + b_conv2)
  h_pool2 = max_pool_2x2(h_conv2)
  </code></pre>
  
  <p>I get the following errors:</p>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-41-7ab0d7765f8c&gt; in &lt;module&gt;()
        3 
        4 h_conv2 = tf.nn.relu(conv2d(h_pool1, W_conv2) + b_conv2)
  ----&gt; 5 h_pool2 = max_pool_2x2(h_conv2)
  
  ValueError: ('filter must not be larger than the input: ', 'Filter: [', Dimension(2), 'x', Dimension(2), '] ', 'Input: [', Dimension(1), 'x', Dimension(4), '] ')
  </code></pre>
  
  <p>Just for some background information, the data that I'm dealing with is a CSV file where each row contains 10 features and 1 empty column that can be a 1 or a 0. What I'm trying to get is a probability in the empty column that the column will equal a 1.</p>