Grader says who_is_it function is incorrect but I'm passing the unit tests

I submitted my week 4 assignment 1 and I pass all the unit tests but the grader is saying the following:

Code Cell UNQ_C1: Function ‘triplet_loss’ is correct.
Code Cell UNQ_C2: Function ‘verify’ is correct.
Code Cell UNQ_C3: Function ‘who_is_it’ is incorrect. Check implementation.
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.

Not much functionality in here, so I’m not sure where to look. Any ideas?


Hi, Alon.

Welcome to the course! Just for future reference, when you post a question, please say which assignment you are talking about. All you’ve really told us is that it’s somewhere in Course 4. Fortunately in this case, I recognize the name of the function and it’s from the Face Recognition assignment in Week 4. :nerd_face:

You’re right that there aren’t many moving parts here. One common type of error is to reference global variables rather than the actual parameters being passed into the test case. The grader uses different parameters, so it works in the notebook and fails in the grader. An example of this would be directly referencing FRmodel within the function instead of using the model parameter that is passed in.

Well, so much for that theory: I tried making the “FRmodel” mistake and that passes the grader. Sigh.

Thanks for the crazy fast response. Turns out my function was fine, but I needed to clear output and resubmit.

BTW, you have correctly pointed out that I’m new to this forum. I want to help others when they search. I tried to clarify what week and what assignment with this sentence “I submitted my week 4 assignment 1 and I pass all the unit tests but the grader is saying the following:” Is there a better way? Will do so next time.

Glad to hear you got it to work. One thing to be aware of is that the grader does not do an automatic “Save” for you, so just because the code you see in the notebook works, that may not be what the grader is seeing.

The new wording you added helps a lot! You can also throw in the name of the assignment (Face Recognition) to be 100% sure. At least you’re more likely to get a “cache hit” on that than remembering which assignments are in which week. :smiley:

Got it, very helpful. Thanks again.