 <p><code>gen.flow_from_directory</code> gives you a generator. The images are not really generated. In order to get the images, you can iterate through the generator. For example</p> <pre><code>i = 0 for batch in gen.flow_from_directory(path+'train', target_size=(224,224), class_mode='categorical', shuffle=False, batch_size=batch_size, save_to_dir=path+'augmented', save_prefix='hi'): i += 1 if i &gt; 20: # save 20 images break # otherwise the generator would loop indefinitely </code></pre>