Course 4 week 4 - grading 66/100

Hi! In my code everything works as asked. It passed all the tests and however I got that grade, I rechecked it and couldn´t find an error.
The grader wrote:
Code Cell UNQ_C1: Function ‘triplet_loss’ is correct.
Code Cell UNQ_C2: Function ‘verify’ is correct.
Code Cell UNQ_C3: Unexpected error (UnboundLocalError(“local variable ‘identity’ referenced before assignment”)) occurred during function check. We expected function who_is_it to return compute_layer_style_cost test 1 failed. Please check that this function is defined properly.
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.

Has anyone experienced the same situation?

This is the code from exericse 3:

Step 1: Compute the target “encoding” for the image. Use img_to_encoding() see example above. ## (≈ 1 line)

{moderator edit - solution code removed}

Your code looks correct to me. There really aren’t that many moving parts here. One thing to realize is that the grader does not do an automatic “Save” for you in Course 4. So maybe the correct code you are looking at is not what the grader is actually seeing. Try doing a “Save” and then “Submit” again. Of course by now your notebook session has expired, so you’ll have to restart. Does the code still look the same as above?