Machine Learning with Python Projects - Cat and Dog Image Classifier

Tell us what’s happening:
Describe your issue in detail here.
I am not able to get the images of test directory
Your code so far
test_image_generator = ImageDataGenerator(rescale = 1 / 255)

test_data_gen = test_image_generator.flow_from_directory(
batch_size = batch_size,
target_size=((IMG_HEIGHT, IMG_WIDTH)),
directory = test_dir,
class_mode = None,
shuffle=False
)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0

Challenge: Machine Learning with Python Projects - Cat and Dog Image Classifier

Link to the challenge:

Hi, the directory path should be path and you should mention the classes argument to be test. Hope this helps

The following worked for me (using spyder IDE):

test_data_gen =  test_image_generator.flow_from_directory(directory=PATH,
                                                       target_size=(IMG_WIDTH,IMG_HEIGHT),classes=['test'],
                                                       class_mode=None,shuffle=False)

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.