I am trying to concatenate two datasets that were created using the keras.preprocessing.image_dataset_from_directory() with the paths as follows:
>>> val_ds = tf.keras.preprocessing.image_dataset_from_directory(
Val_data_dir,
image_size=(127, 127),
batch_size=32)
Found 16 files belonging to 2 classes.
>>> train_ds = tf.keras.preprocessing.image_dataset_from_directory(
Train_data_dir,
image_size=(127, 127),
batch_size=32)
Found 5216 files belonging to 2 classes.
>>> print(len(list(train_ds)))
131
When I print the length of the list in train_ds, it's showing 131 when I'm expecting 5216 that it found when it loaded it from the directory. Can someone explain why? What other function should I use to get the number of files loaded in the dataset?