keras flow_from_directory returns 0 images When I try to use the following snippet of code to try to predict on a batch of images, I get a message saying that no image were found.

test_datagen = ImageDataGenerator()

test_generator = test_datagen.flow_from_directory(
        directory='test/',
        target_size=(300, 300),
        color_mode="rgb",
        shuffle = False,
        class_mode='binary',
        batch_size=1)

filenames = test_generator.filenames


My directory structure is as follows. 
I first have a main directory named dogs_vs_cats in which I have two sub directories train and test containing the respective images and also the notebook which contains this code.
Keras generator alway looks for subfolders (representing the classes). Images insight the subfolders are associated with a class.

So whan you work on C:\images\ and you have two classes, say C1, C2, you need to create subfolders C:\images\C1\ and C:\images\C2\. The directory insight the generator function should point to C:\images\.

See this post for the case of image prediction: https://stackoverflow.com/a/55991598/9524424