title: Keras Image Data Generator: fit_generator() argument error
body: <p>For a project on the cifar10 dataset from Keras, I've run into a wall in terms of image augmentation. In short, I've followed the description from the Keras documentation: <a href="https://keras.io/preprocessing/image/" rel="nofollow noreferrer">https://keras.io/preprocessing/image/</a>. However, I'm not able to run my code as an argument error occurs on the fit_generator function (see below):</p>
  
  <pre><code>TypeErrorTraceback (most recent call last)
  /home/nct01/nct01002/new_MAI-DL/lab_1/code_lab1.3.py in &lt;module&gt;()
       86 #trying the dataaugmentation fit function
       87 history = nn.fit_generator(datagen.flow(x_train, y_train, batch_size=32),
  ---&gt; 88                     steps_per_epoch=len(x_train) / 32, epochs=30, validation_sp
  lit=0.15)
       89 
       90 #Evaluate the model with test set
  </code></pre>
  
  <p>Here is the code I've used for preparing the data:</p>
  
  <pre><code>#Load the CIFAR dataset, already provided by Keras
  (x_train, y_train), (x_test, y_test) = cifar10.load_data()
  
  #Check sizes of dataset
  print 'Number of train examples', x_train.shape[0]
  print 'Size of train examples', x_train.shape[1:]
  
  #Normalize data
  x_train = x_train.astype('float32')
  x_test = x_test.astype('float32')
  x_train = x_train / 255
  x_test = x_test / 255
  
  
  #import library for data augmentation
  from keras.preprocessing.image import ImageDataGenerator
  
  #prepare image augmentation
  datagen = ImageDataGenerator(
      featurewise_center=True,
      featurewise_std_normalization=True,
      rotation_range=20,
      width_shift_range=0.2,
      height_shift_range=0.2,
      horizontal_flip=True)
  
  # apply datagen to training data
  datagen.fit(x_train)
  </code></pre>
  
  <p>And here is the code for initializing the training:</p>
  
  <pre><code>#trying the dataaugmentation fit function
  history = nn.fit_generator(datagen.flow(x_train, y_train, batch_size=32),
                      steps_per_epoch=len(x_train) / 32, epochs=30, validation_split=0.15)
  </code></pre>
  
  <p>P.s.: For the project, I'm required to use Keras version 1.1.1</p>