Hi, i came across this error in the train_val_generators
Failed test case: There was an error grading this function. Details shown in 'got' value below:.
Expected:
no exceptions,
but got:
must be real number, not NoneType.
this is my code:
# GRADED FUNCTION: train_val_generators
def train_val_generators(TRAINING_DIR, VALIDATION_DIR):
### START CODE HERE
# Instantiate the ImageDataGenerator class (don't forget to set the rescale argument)
train_datagen = ImageDataGenerator(1./255)
# Pass in the appropiate arguments to the flow_from_directory method
train_generator = train_datagen.flow_from_directory(directory=TRAINING_DIR,
batch_size=100,
class_mode="binary",
target_size=(150, 150))
# Instantiate the ImageDataGenerator class (don't forget to set the rescale argument)
validation_datagen = ImageDataGenerator(1./255)
# Pass in the appropiate arguments to the flow_from_directory method
validation_generator = validation_datagen.flow_from_directory(directory=VALIDATION_DIR,
batch_size=20,
class_mode="binary",
target_size=(150, 150))
### END CODE HERE
return train_generator, validation_generator
i believe this is almost exactly the same with the code from the example earlier in the course. What am i missing?