C2W4 Ex4 - where's the train_generator code?

Working way through exercise and confused. In prev exercises we’ve defined train_datagen=ImageDataGenererator(…) and then defined train_generator = train_datagen.flow_from_directory(…) before moving on to model.compile and model.fit_generator.

However, this Ex4 notebook doesnt include any train_generator assignment or ‘insert code here’ related to it. I’ve gathered we’re not using the .flow_from_directory method of the data generator given we’ve set up the training image tensor and labels tensor. So, do we still assign a train_generator (using something other than .flow_from_directory method)??? Im stuck here.

Thanks

Hi

Nevermind - I sussed it out.

I figured out no need to assign a train_generator = train_datagen.flow_from_directory() object and instead used the method train_datagen.flow(training_images, training_labels, batch_size=32) as the first argument to history = model.fit_generator().

3 Likes

btw, the fit_generator() is deprecated. According to the output of TF, you can you fit instead.