Course 4 week 2 Transfer learning Accuracy metrics error

code removed
i have initialized in this way…But it indicates that this should be of type string.I’m unable to correct it …
help me in this…

Hey, what’s the error message you’re getting?

Obviously the quote characters aren’t the correct ones. I’d speak of a shameful cut and paste. :stuck_out_tongue_closed_eyes:

Unexpected error occurred during variable check. We expected variable metrics to be of type <class ‘str’>. Please check that this variable is initialized and is of the right type.
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.

the error is this
AssertionError Traceback (most recent call last)
3 assert type(optimizer) == tf.keras.optimizers.Adam, “This is not an Adam optimizer”
4 assert == base_learning_rate / 10, “Wrong learning rate”
----> 5 assert metrics[0] == ‘accuracy’, “Wrong metric”
7 print(’\033[92mAll tests passed!’)

AssertionError: Wrong metric

If it passes in the notebook but fails while grading, I feel like the file might not have saved automatically. Could you try to submit after clicking the save icon in the toolbar? (I’ll also be removing the code in the first post).

1 Like

Did you use the tensorflow function for the optimizer?