# ValueError: Rank mismatch: Rank of labels (received 2) should equal rank of logits minus 1 (received 2)

I'm new in deep learning .I cannot understand this error : `ValueError: Rank mismatch: Rank of labels (received 2) should equal rank of logits minus 1 (received 2).`

```
input shape = (batch, 64, 64)
labels = (1,)
```

Traceback (most recent call last): File "new.py", line 103, in loss_op = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=Y)) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/nn_ops.py", line 2040, in sparse_softmax_cross_entropy_with_logits (labels_static_shape.ndims, logits.get_shape().ndims))

ValueError: Rank mismatch: Rank of labels (received 2) should equal rank of logits minus 1 (received 2).

```
logits = conv_net(X, weights, biases, keep_prob)
prediction = tf.nn.softmax(logits)
loss_op = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=Y))
optimizer = tf.train.AdamOptimizer(learning_rate=0.001)
train_op = optimizer.minimize(loss_op)
correct_pred = tf.equal(tf.argmax(prediction, 1), tf.argmax(Y, 1))
accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))
```