title: ValueError: Error when checking target: expected predictions to have 4 dimensions, but got array with shape (256, 1, 1)
body: <p>I'm trying to train a model Keras but I'm having a problem:</p>
  
  <pre><code>g = ImageDataGenerator(featurewise_center=True,
                      featurewise_std_normalization=True,
                      rotation_range=45,
                      width_shift_range=0.2,
                      height_shift_range=0.2,
                      horizontal_flip=True,
                      validation_split=validation_split,
                      preprocessing_function=lambda x: x / 127 - 1)
  
  g_train = g.flow(x_train, y_train,
               batch_size=batch_size,
               subset='training')
  
  g_valid = g.flow(x_train, y_train,
               batch_size=batch_size,
               shuffle=False,
               subset='validation')
  
  
  history = network.fit_generator(g_train,
                            steps_per_epoch=len(x_train) / 32, 
                            epochs=epochs)
  
  ValueError: Error when checking target: expected predictions to have 4 dimensions, but got array with shape (256, 1)
  </code></pre>
  
  <p>Someone have any idea why? It seems much like the example in documentation to me.</p>
  
  <pre><code>x_train.shape
  (50000, 32, 32, 1)
  y_train.shape
  (50000, 1, 1)
  </code></pre>