Deeplearning specialization Course 5 Week 2, programming assignment 2


The codes were filled and testing passed, but with feedback as failed as shown in the attached screenshot. Please advice whether it is due to mistakes in my codes or anything else. Thanks.

Yes, there is an error in your code.

Although all the tests passed, the accuracy is below 70%. Is this the reason why my submission is failed?

Passing all of the tests in the notebook does not prove your code is perfect.
The grader uses totally different tests.

I recommend you strive for 100%, regardless of what grade gives you a passing score.


I remembered I made some change to this area as shown in the attached screenshot, from something I forgot to ā€œorangeā€ as text of ā€œorangeā€ appeared in the feedback. I guess maybe it is the reason why the grader judged my assignment was failed. And as you know, if there were some mistakes in my codes, the result would not be 0%, but 70% or else like.

Hi @nickchen6 ,

The KeyError is raised because the mapping of the key ā€˜orangeā€™ doesnā€™t exist. So you need to change it back to what it was, rerun the code from start, ensuring no error before submitting to the grader.
You can get a fresh copy of the assignment by clicking the ā€˜?ā€™ button on the top of the Coursera window, rename your current file first before getting an update version of the assignment.

Iā€™d like to start over on a fresh state. Could you please advice me how to do it?

But clicking the ā€œ?ā€ button seems not coming back the the fresh status.

Here is the guide on how to get a fresh copy of your assignment.

1 Like

After restarting over on a fresh version, now the error is like this as shown in the attached screenshot, although all the tests passed. Could you please advice how to debug?

Have you completed the entire notebook?

You canā€™t grade a partially finished notebook.

Yes, I have completed the entire notebook and then submitted and got feedback like this.

First, check that you have not changed the notebook filename.

Then please check your personal messages for instructions.

Update for those finding this thread.

The fixes for this issue involved the following (though no concrete cause could be determined):

  • Using the pretrained_embedding_layer() function where it is referenced in the instructions.
  • Getting fresh copies of the utility .py files for this assignment.
  • Restarting the kernel and clearing all of the output data, then running all of the cells again, checking the results carefully, before submitting for grading.
1 Like

I got stucked and couldnā€™t help myself pls.

where can I go from here?

What problem are you having exactly?

Please post a screen capture image that shows any error messages you are seeing, or the detailed report from the grader.

Do not include your code.