title: Train keras model using generated by Augmentor images
body: <p>I'm trying to train keras model using keras_generator from library Augmentor and trouble is that I can't get more images then I already have.</p>
  
  <p>Now I have a directory with clasees:</p>
  
  <pre><code>images/
   0/0.png
   1/1.png
   ...
   z/z.png
  </code></pre>
  
  <p>I run following python code:</p>
  
  <pre><code>import Augmentor
  pipeline = Augmentor.Pipeline("images")
  pipeline.rotate(probability=0.7, max_left_rotation=10, max_right_rotation=10)
  pipeline.zoom(probability=0.5, min_factor=1.1, max_factor=1.3)
  pipeline.random_distortion(probability=0.8, grid_width=4, grid_height=4, magnitude=1)
  pipeline.greyscale(1.0)
  pipeline.invert(1.0)
  pipeline.status()
  </code></pre>
  
  <p>Which gives an output:</p>
  
  <pre><code>    Initialised with 22 image(s) found.
  Output directory set to images/output.Operations: 5
      0: RotateRange (probability=0.7 max_left_rotation=-10 max_right_rotation=10 )
      1: Zoom (probability=0.5 min_factor=1.1 max_factor=1.3 )
      2: Distort (probability=0.8 grid_width=4 grid_height=4 magnitude=1 randomise_magnitude=True )
      3: Greyscale (probability=1.0 )
      4: Invert (probability=1.0 )
  Images: 22
  Classes: 22
      Class index: 0 Class label: 0 
      ...
      Class index: 20 Class label: x 
      Class index: 21 Class label: y 
  Dimensions: 1
      Width: 28 Height: 28
  Formats: 1
       PNG
  </code></pre>
  
  <p>Then I create a model:</p>
  
  <pre><code>from keras.preprocessing.image import ImageDataGenerator
  from keras.models import Model
  from keras.optimizers import Adam
  from keras.layers import Conv2D, Input, Dropout, Flatten, Dense, MaxPooling2D
  
  img_input = Input(shape=(28, 28, 1))
  x = Conv2D(32, 3, activation='relu')(img_input)
  x = Conv2D(64, 3, activation='relu')(x)
  x = MaxPooling2D(2, 2)(x)
  x = Dropout(0.25)(x)
  x = Flatten()(x)
  x = Dense(128, activation='relu')(x)
  x = Dropout(0.5)(x)
  output = Dense(22, activation='softmax')(x)
  
  model = Model(img_input, output)
  model.compile(loss='categorical_crossentropy',
                optimizer=Adam(),
                metrics=['acc'])
  </code></pre>
  
  <p>And give it a generator to train on:</p>
  
  <pre><code>generator = pipeline.keras_generator(batch_size=128)
  model.fit_generator(generator, steps_per_epoch=len(pipeline.augmentor_images)/128, epochs=5, verbose=1)
  </code></pre>
  
  <p>Which retruns me an output</p>
  
  <pre><code>    WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
  Instructions for updating:
  Use tf.cast instead.
  Epoch 1/5
  1/0 [==============================================================================================================================================================================] - 1s 1s/step - loss: 3.1237 - acc: 0.0312
  Epoch 2/5
  1/0 [==============================================================================================================================================================================] - 0s 361ms/step - loss: 2.9429 - acc: 0.1797
  Epoch 3/5
  1/0 [==============================================================================================================================================================================] - 0s 298ms/step - loss: 2.7841 - acc: 0.2188
  Epoch 4/5
  1/0 [==============================================================================================================================================================================] - 0s 417ms/step - loss: 2.4919 - acc: 0.3672
  Epoch 5/5
  1/0 [==============================================================================================================================================================================] - 0s 439ms/step - loss: 2.2927 - acc: 0.3438
  </code></pre>
  
  <p>So it sees only one picture that was in image directory for aproppriate class. How can I feed it thousands not saving pictures on disk?</p>