title: Tensorflow: "logits and labels must be the same size"
body: <p>I have built a deep CNN based on a research paper and now I am attempting to train it. After all the convolutions and deconvolutions I have performed, I have a result called final.</p>
  
  <pre><code>final = tf.add(add1,add2)
  print(final)
  
  Tensor("Add_35:0", shape=(1, 32, 32, 7, 1), dtype=float32)
  </code></pre>
  
  <p>In my model, I have an image of the size 32x32x7 where each pixel has a corresponding density. The output of the model will be a label for each pixel. Therefore, I have declared two placeholders where "x" represents the input and "y_" represents the output.</p>
  
  <pre><code>x = tf.placeholder(tf.float32, shape=[None, 7168])
  y_ = tf.placeholder(tf.float32, shape=[None, 7168])
  </code></pre>
  
  <p>Now that I am attempting to train the model, I have this line</p>
  
  <pre><code>cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y_, logits=final))
  </code></pre>
  
  <p><strong>When the model is being trained I receive the error : logits and labels must be same size: logits_size=[7168,1] labels_size=[1,7168]</strong>
  It makes sense that labels would be this size since this is how I declared it. <strong>However, I do not understand why logits is of size [7168,1] when printing out "final" has the shape (1, 32, 32, 7, 1).</strong></p>