Grader failing compute_gradient_reg even though code and results are validated

I’m getting an error when grading Exercise 6 on the final logistic regression assignment. Error is:

Code Cell UNQ_C6: Function ‘compute_gradient_reg’ is incorrect. Check implementation.

I pass all tests in the notebook.

Mentor Raymond replied to a previous thread, and he has validated my code and my notebook as working. It passes all tests including the grader in his environment.

I’ve restarted my OS and I’ve used two different browsers, and I get the same error,

I’ve re-loaded the same notebook .ipynb file validated by Raymond, and I get the same error.

The summery of above is that the same .ipynb file passes all test in the mentor’s environment and fails one test in mine.

Thanks for any help,



Can you send me your notebook in a direct message?


Hi Tom! Unfortunately, I am not able to reproduce the issue. By any chance, did you rename the notebook that has the correct answers? If so, then that might be the cause of the issue. The grader will look for the notebook that has the original filename (i.e. C1_W3_Logistic_Regression.ipynb). Please try this:

  1. Open your workspace and rename your old notebook to something else (e.g. C1_W3_Logistic_Regression1.ipynb).
  2. Rename the notebook you got from Raymond to C1_W3_Logistic_Regression.ipynb).
  3. Open the notebook you just renamed and do File > Save and Checkpoint.
  4. Once saved, please resubmit.

Hopefully, you get the grade this time! If not, please reply here. Thanks!

Hey Chris,

The renaming seems to have fixed the issue, but it really doesn’t make sense to me. I used the default C1_W3_Logistic_Regression notebook file until Raymond asked for the download, so almost all of the troubleshooting was with the original notebook name.

It seems these steps fixed the problem:

  1. download the C1_W3_Logistic_Regression notebook as temptgm-Copy1.ipynb
  2. reload the exact same temptgm-Copy1.ipynb
  3. rename the notebook back to C1_W3_Logistic_Regression

After that, I passed the grader.

Here’s the history if it happens again to someone else:

  1. I finished my code and I passed all exposed notebook tests.
  2. I submitted for grading and failed the regularlized gradient test. Notebook name was the default C1_W3_Logistic_Regression up to this point.
  3. Raymond asked for my notebook, and it automatically saved as temptgm-Copy1.ipynb on download.
  4. Raymond confirmed my code, and confirmed that he got 100% from the grader with no changes to my code or notebook.
  5. At Raymond’s request, I loaded my temptgm-Copy1.ipynb and continued to fail the regularized gradient test.
  6. I sent the temptgm-Copy1.ipynb to you.
  7. I reloaded temptgm-Copy1.ipynb, renamed it to the original name, and it passed the grader
    100% without changes.

Thanks for you help…


FYI, I did one last test, and reloaded the temptgm-Copy1.ipynb file, and it now passes all tests and grading without renaming the notebook back to the default. There doesn’t seem to be a notebook name check, so it seems something else changed between yesterday and today.