Problems with submission for grading of C4 W4 A1

Hello,

I have an issue when submitting the assignment for grading. The message I get when the assignment is graded is:

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.

However, the expected output for UNQ_C3 is what I get when I run the function.

Here is what I get when I run UNQ_C3 function who_is_it:
it’s younes, the distance is 0.5992949
it’s younes, the distance is 0.5992949
it’s younes, the distance is 0.0

And this is the expected output:
Expected Output:

it’s younes, the distance is 0.5992949
it’s younes, the distance is 0.5992949
it’s younes, the distance is 0.0

Looks the same to me. I saved the workbook before submitting for grading.

Any thoughts please?

Thanks

Alex

There are lots of ways to pass the tests in the notebook and fail the grader. That means your code is not general. Examples of ways to trigger that are hard-coding assumptions like dimensions of input objects or another popular one is directly referencing global variables within the local scope of your function that just happen to be passed in as parameters. What if the grader passes a different variable?

Thank you Paul. I will review my code, but at first glance I couldn’t see any hard-coding.

Are you sure you didn’t directly reference FRmodel within your function? That’s the second type of mistake I described.

In the encoding variable I referenced model, as that is the input to the function. That’s right, isn’t it?

The only thing I hard coded was min_dist to 100

Hmmm, that’s not a problem. That’s just the initial high value for it and then you calculate the real value.

Did you use TF or numpy for calculating the norm? Either should work, but maybe you mixed the two.

I used numpy, the same formula used in previous function- verify

Ok, I give up, time to use the “In case of emergency, break glass” method. Please check your DMs …