Stop using Keras-ImageDataGenerator because…

This article is the follow up from Part 1. Here, I will compare the tf.data and Keras.ImageDataGeneratoractual training times using the mobilenetmodel.


Image for post

Photo by the Author. From YouTube Video

In Part 1, I showed that loading images using tf.data is approximately 5 times faster in comparison toKeras.ImageDataGenerator. The dataset considered was Kaggle- dogs_and_cats (217 MB) having **10000 images **distributed among 2 different classes.

In this Part 2, I have considered a bigger dataset which is commonly used for image classification problems. The dataset chosen is COCO2017 (18 GB) having **117266 images **distributed among **80 different classes. **Various versions of COCO datasets are freely available to try and test at this link. The reason for choosing the bigger dataset of 18 GB is to have better comparison results. For a practical image classification problem, datasets can be even bigger ranging from 100 GB (gigabytes)to a few TB (terabytes). In our case, 18 GB of data is enough to understand the comparison as using the dataset in TB would significantly increase the training times and computational resources.

#keras #machine-learning #deep-learning #tensorflow #artificial-intelligence #deep learning

Dump Keras-ImageDataGenerator. Start Using TensorFlow-tf.data
2.30 GEEK