title: Rank of labels (received 1) should equal rank of logits minus 1 (received 4)
body: <p>I have a <code>tf.RandomShuffleQueue</code> called data_queue defined as follows :</p>
  
  <pre><code>self.data_queue = tf.RandomShuffleQueue(capacity=1024,
                                                      min_after_dequeue=21,
                                                      dtypes=[tf.float32,
                                                              tf.int32],
                                                      shapes=[[221, 221, 3], []],
                                                      name="data_queue")
  </code></pre>
  
  <p>I am able to successfully enqueue data items into it.</p>
  
  <p>The dequeue operation is defined as follows :</p>
  
  <pre><code>        [self.batch_images, self.batch_labels] = self.data_queue.dequeue_up_to(self.batchsize)
  </code></pre>
  
  <p>In the above snippet <code>self.batchsize</code> is a constant tensor.</p>
  
  <p>The issue starts now as follows :</p>
  
  <p>I want to push these directly to my graph. Just for clarity the first layer of my graph is as follows :</p>
  
  <pre><code>conv1 = tf.layers.conv2d(self.batch_images, filters=96, kernel_size=7,
                                       strides=2,
                                       activation=tf.nn.relu,
                                       kernel_regularizer=tf
                                       .random_uniform_initializer,
                                       name='conv1')
  </code></pre>
  
  <p>The last few lines where the error is referenced are :</p>
  
  <pre><code>drop2 = tf.layers.dropout(fc2, name='drop2')
  cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(
                  logits=drop2,
                                                          labels=self.batch_labels,
                                                                    name="cross_entropy_per_example")
  </code></pre>
  
  <p>The error I receive is :</p>
  
  <pre><code>line 1709, in sparse_softmax_cross_entropy_with_logits
      (labels_static_shape.ndims, logits.get_shape().ndims))
  ValueError: Rank mismatch: Rank of labels (received 1) should equal rank of logits minus 1 (received 4).
  </code></pre>
  
  <ol>
  <li><p>When I checked the <code>tf.rank</code> of <code>self.images</code> and <code>self.labels</code>, I got the following :</p>
  
  <p>Labels
  Tensor("Rank:0", shape=(), dtype=float32)
  Images
  Tensor("Rank_1:0", shape=(), dtype=int32)</p></li>
  </ol>
  
  <p>What is the reason for it ?</p>
  
  <p><strong><em>NOTE</em></strong> I do not want to use <code>tf.placeholder</code> and <code>feed_dict</code>. I want to connect the <code>self.data_queue</code> directly to the graph.</p>