TF1-C2W2 Graded Assignment

Received this error after running the “train_val_generators” function with no reported errors:
NameError Traceback (most recent call last)

in 1 # Test your generators ----> 2 train_generator, validation_generator = train_val_generators(TRAINING_DIR, VALIDATION_DIR)

NameError: name ‘train_val_generators’ is not defined

Where should I look to fix this?

Are you running the cell containing the definition of the function train_val_generators before invoking the cell that tests it?

Yes I was. That problem seems to have fixed itself- I don’t know why. But now I have the follow on problem:
" in 1 # Get the untrained model ----> 2 model = create_model() 3 4 # Train the model 5 # Note that this may take some time.

in create_model() 20 21 —> 22 model.compile(optimizer= RMSprop(learning_rate=1e-4), 23 loss=‘binary_crossentropy’, 24 metrics=[‘accuracy’])

NameError: name ‘RMSprop’ is not defined
Can you help with this one?

This is a python related error of not importing the symbol before using it. RMSprop is defined in tf.keras.optimizers

Ok, I thought it came in with the other imports. Would you please give me the exact syntax for importing RMSprop? It’s not gradeable, right?

I’ve already provided the package path.

This specizalization assumes that you are familiar with python. If you have new to python, start here. There are plenty of tutorials on coursera at a beginner level as well. Good luck.