title: Data augmentation using Keras image generator makes training very slow
body: <p>I have a big data set. Data is about 100k. I further augmented data using <strong>ImageDataGenerator</strong> . But it makes training process very slow. Without keras image generator function, training process took about 3 mins but when I use ImageDataGenerator function it took about more that 3 hours. I used this code for image augmentation. How to improve the performance?</p>
  
  
  
  <pre class="lang-python prettyprint-override"><code>datagen = ImageDataGenerator(horizontal_flip=True,
                               vertical_flip=True,
                               featurewise_center=True,
                               featurewise_std_normalization=True,
                               zoom_range=0.2,
                               rotation_range=90.)
  datagen.fit(data)
  epochs = 50
  
  model.fit_generator(datagen.flow(data, label, batch_size=128),
                      steps_per_epoch=patches.shape[0],
                      epochs=epochs)
  </code></pre>