A gentle introduction to tf.data with TensorFlow
A gentle introduction to tf.data with TensorFlow – PyImageSearch
“Users of the PyTorch library are likely familiar with the Dataset and DatasetLoader classes — they make loading and preprocessing data incredibly easy, efficient, and fast.
Up until TensorFlow v2, Keras and TensorFlow users would have to either:
Manually define their own data loading functions
Utilize Keras ImageDataGenerator function for working with image datasets too large to fit into memory and/or when data augmentation needed to be applied
Neither solution was the best.
Manually implementing your own data loading functions is hard work and can result in bugs. The ImageDataGenerator function, while a perfectly fine option, wasn’t the fastest method either.
The TensorFlow v2 API has gone through a number of changes, and arguably one of the biggest/most important changes is the introduction of the tf.data module…”