Course 4 (CNN) Week 2 Assignment 2 grader output shows error in'accuracy'

All test passed but the grader output shows 66/100 for the transfer learning problem.
The grader output shows following error:
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.
This dependency may be the cause of the errors.

The metric is defined as: metrics=[‘accuracy’].

Please let me know what exactly is the issue. I believe above line should store metric as string.

Hi shendesc,

Your definition of metrics seems to be fine. This means that there is probably an issue somewhere else, the nature of which is difficult to deduce from the error message. In case you have not resolved this issue yet, feel free to send me your code in a direct message so I can have a look.

Hey, Thanks for reply. I did messaged you the code.

Same problem here. Did you solve this?

I am having the same error as well.

Can you verify if this is for Exercise 3 (fine-tuning the model)?
Does the error only happen when you submit for grading, or do you get an error when you run the notebook cells?

This was for Exercise 3. I just tried resubmitting the assignment and was given 100/100 instead of 66/100 even though I didn’t change anything

Sometimes the kernel gets confused and has to be restarted before everything will work correctly.

Also this exercise has a lot of global variables, and that can cause problems unless the cells are run in exactly the expected order.

I tried restarting the kernel and clearing the output. It worked! Thank you.

thanks, it works after restarting the kernel