When the model has only one input, I used tf.keras.preprocessing.image_dataset_from_directory method to feed images and labels. If the model has two or more inputs