Flow_from_directory does not get all images in the folder

I am doing W1 assignment.

In some part, I moved images into separated folder and got expected output as suggested.

-------------------

Expected Output:

666.jpg is zero length, so ignoring. 11702.jpg is zero length, so ignoring.There are 11250 images of cats for training There are 11250 images of dogs for training There are 1250 images of cats for validation There are 1250 images of dogs for validation


However, when I feed it into the function

Test your generators train_generator, validation_generator = train_val_generators(TRAINING_DIR, VALIDATION_DIR)

I got

Found 22450 images belonging to 2 classes.

Found 2498 images belonging to 2 classes.

slightly different than the expected output due to random sampling.


Expected Output:

Found 22498 images belonging to 2 classes.

Found 2500 images belonging to 2 classes.


Q: What caused to the images dropped?

Does this post help?

1 Like

Yah, it is a repeated question and it solved my problem. Thanks!