The method I am aware of is something like this
from tensorflow.keras.preprocessing.image import ImageDataGenerator
train_datagen = ImageDataGenerator(rescale=1./255)
val_datagen = ImageDataGenerator(rescale=1./255)
train_generator = train_datagen.flow_from_directory(
train_dir,
target_size=(150, 150),
batch_size=20, <---------------------------
class_mode='binary')
But I want to change batch size while training in model.fit() method and it won't happen because batch_size has already been set in flow_from_directory()
So how do I load this dataset so that I've the freedom to change the batch_size while training?
All the efforts are highly appreciated