title: ImageDataGenerator.flow() gives IOError: [Errno 2] No such file or directory
body: <p>I was following the tutorial given here: <a href="https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html" rel="nofollow noreferrer">https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html</a></p>
  
  <p>On executing the first half i.e. the data preprocessing code : </p>
  
  <pre><code>for batch in datagen.flow(x, batch_size=1,
  save_to_dir='preview', save_prefix='cat', save_format='jpeg'):
      i += 1
      if i &gt; 20:
          break
  </code></pre>
  
  <p>I get the error : </p>
  
  <pre><code>`fp = builtins.open(filename, "w+b")
  </code></pre>
  
  <p>IOError: [Errno 2] No such file or directory: 'preview/cat_0_7886.jpeg`</p>
  
  <p>How do I solve this?</p>