I am resizing my RGB images stored in a folder(two classes) using following code:
from keras.preprocessing.image import ImageDataGenerator
dataset=ImageDataGener
The flow_from_directory
method gives you an "iterator", as described in your output. An iterator doesn't really do anything on its own. It's waiting to be iterated over, and only then the actual data will be read and generated.
An iterator in Keras for fitting is to be used like this:
generator = 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)
for inputs,outputs in generator:
#do things with each batch of inputs and ouptus
Normally, instead of doing the loop above, you just pass the generator to a fit_generator
method. There is no real need to do a for loop:
model.fit_generator(generator, ......)
Keras will only save images after they're loaded and augmented by iterating over the generator.