Writing Custom TDFS Dataset – Getting Error
I am trying to write a custom TFDS dataset.
TensorFlow image_dataset_from_directory not mapping labels correctly
I am using the following code to read *.jpg files from the “labeled_data_dir”
Labels are age of person.
training_dataset= tf.keras.utils.image_dataset_from_directory(
labeled_data_dir,
image_size=image_size, # Resize images (adjust as needed)
batch_size=batch_size # Batch size for training (adjust as needed)
seed=9,
validation_split=0.2,
subset=”training”
labels=”inferred”,
label_mode=”int”
)
The files in directory are structured under each sub-directory, where sub-directory is name of labels.
Function also prints it as
“Found 10137 files belonging to 80 classes”