Sign in

a cute dog

TensorFlow’s ImageDataGenerator class is a great way to read your dataset and perform data augmentation, but it is not really straightforward. You have to organize your images into folders with a certain structure. Let’s say you are doing binary classification, meaning you have two classes, and following the mainstream example of cats and dogs. Assuming you have 10,000 images, my suggestion would be to set aside 8,000 for training and 2,000 for validation. You can obviously arrange the proportions depending on how large your dataset is.

Organize your dataset in the following way:


Bora Elci

Computer Science Student

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store