title: how to save resized images using ImageDataGenerator and flow_from_directory in keras
body: <p>I am resizing my RGB images stored in a folder(two classes) using following code:</p>
  
  <pre><code>from keras.preprocessing.image import ImageDataGenerator
  dataset=ImageDataGenerator()
  dataset.flow_from_directory('/home/1',target_size=(50,50),save_to_dir='/home/resized',class_mode='binary',save_prefix='N',save_format='jpeg',batch_size=10)
  </code></pre>
  
  <p>My data tree is like following:</p>
  
  <pre><code>1/
   1_1/
       img1.jpg
       img2.jpg
       ........
   1_2/
       IMG1.jpg
       IMG2.jpg
       ........
  resized/
          1_1/ (here i want to save resized images of 1_1)
          2_2/ (here i want to save resized images of 1_2)
  </code></pre>
  
  <p>After running the code i am getting following output but not images:</p>
  
  <pre><code>Found 271 images belonging to 2 classes.
  Out[12]: &lt;keras.preprocessing.image.DirectoryIterator at 0x7f22a3569400&gt;
  </code></pre>
  
  <p>How to save images?</p>