Error "Can't compile" in lab under Convolutional Neural Networks

In Course 4 Lab, I receive this error when I submit the assignment:

  • Cell #16. Can’t compile the student’s code. Error: FileNotFoundError(2, ‘No such file or directory’)

This might be due to the function who_is_it() which was a graded implementation. But the implementation worked in other cells.

Which week, and which assignment number?

Convolutional Neural Networks
→ Week 4
→ Face Recognition (Assignment 1)

Suspected the Error comes from this line around Cell 17 in function who_is_it():
encoding = img_to_encoding(image_path, model)

I figure out the issue.

When calculating the distance in the verify function as:
dist = np.linalg.norm(encoding- encoding_check)
I have used

  • encoding_check = img_to_encoding(os.path.join(“images”, identity + “.jpg”), model)
    The “correct” way which allowed me to pass the grading is
  • encoding_check = database[identity]

Would the first method be also acceptable?