title: Output layer's shape is always (1,)
body: <p>I am trying to make a simple Keras model. But regardless of what output shape I am specifying the output layer is always of the shape <code>(1,)</code> so I cannot train my model because of the output layer and target data shapes mismatch.</p>
  
  <pre class="lang-py prettyprint-override"><code>import keras
  from keras.models import Sequential
  from keras.layers import InputLayer, LSTM, Dense
  
  # 63 is the number of unique characters
  # 128 is the length of a sequence of characters
  
  X = ... # X is an one-hot ndarray; X.shape == (96092, 128, 63)
  Y = ... # Y is an one-hot ndarray; Y.shape == (96092, 63)
  
  model = Sequential()
  model.add(InputLayer([128, 63]))
  model.add(LSTM(96))
  model.add(Dense(63))
  
  model.compile(
    optimizer=keras.optimizers.RMSprop(1e-3, decay=1e-5),
    loss=keras.losses.sparse_categorical_crossentropy,
  )
  
  model.fit(X, Y) # ValueError: Error when checking target: expected dense_4 to have shape (1,) but got array with shape (63,)
  </code></pre>
  
  <p>As you can see, the shape of the output dense layer is <code>(1,)</code> but it has to be of shape <code>(63,)</code>. What am I doing wrong?</p>
  
  <p>I am using Google Colab with preinstalled Keras.</p>