title: Error in Input Dimensions - Keras
body: <p>I'm training a neural net with keras with input data that has a shape of (116, 2, 3, 58) and output data that has a shape of (116, 2). I'm getting this error:</p>
  
  <pre><code>ValueError: Error when checking target: expected dense_3 to have 4 dimensions, but got array with shape (116, 2)
  </code></pre>
  
  <p>What could I be doing wrong? Here is my code:</p>
  
  <pre><code>trainingInput = np.load("trainingInput.npy")
  trainingOutput = np.load("trainingOutput.npy")
  
  inp = Input(batch_shape=(116, 2, 3, 58))
  d1 = Dense(16, activation='relu')(inp)
  d2 = Dense(32, activation='relu')(d1)
  out = Dense(2, activation='softmax')(d2)
  
  model = Model(inputs=inp, outputs=out)
  lrSet = SGD(lr=0.01)
  
  model.compile(loss='categorical_crossentropy', optimizer=lrSet, metrics=['accuracy'])
  model.fit(trainingInput, trainingOutput, batch_size=16, epochs=50, verbose=1, validation_split=0.1)
  </code></pre>