Course 1 - Week 3: Grader Error - Planar_data_classification_with_one_hidden_layer

Dear DLS Team.
I found the same issue when submitting Course 1 - Week 3 “Programming Assignment: Planar Data Classification with One Hidden Layer”.
An error is reported:
Grader Error:
Grader feedback not found

I follow the instruction in the assignment, but still got the error. Could you please help me how to resolve this issue?

Sincerely yours,
Jim

I tried to open manually file “public_tests.py” and run it on my local PC, it seems like the code has some inconsistence result

I test manually the value Y_2 and A2, and the code that I wrote for function compute_cost is already correct according to the formula. However the expected_output_1 value in the public_tests.py is not similar or same with the output of compute_cost function. That’s why I got error:

AssertionError: Wrong value. Expected: 0.5447066599017815 got: 1.0493608309109266

So, I think there is problem with compute_cost_test function in public_tests.py file provided by the system.

There is no problem with the test functions. They’ve been in use for a half of a decade.

If a test says there’s a problem in your code, you should believe it.

Thank you for the response.

Sincerely yours,
jim

You are reporting at least two distinct errors here. The first error from the grader about “Grader feedback not found” usually means that there is something pretty serious wrong. Either you have modified parts of the notebook outside of the “YOUR CODE HERE” sections or perhaps there is a serious error in your implementation someplace.

Does your code pass the tests when you run them in the notebook on Coursera?

Note that if you run the code in a different environment, you may have several levels of problems that are caused by “versionitis”: the versions of all the packages used in the assignments are 5 years old at this point and there is no guarantee that things will work if you run them with the current up to the minute versions of all the various packages that we use here.

There are other steps we can take to debug this problem if the above suggestions don’t shed any light.

I didn’t modify the notebook outside the sign “YOUR CODE HERE”.
I have problem only in part of function compute_cost, I tried to follow the formula of cost function as described in the notebook, and used the suggested syntax which is using np.multiply and then np.sum. However, I still got the AssertionError as I posted above. Nevertheless, I just continue the code in the next cells and got no errors. Then I clicked the “Submit Assignment” even though the AssertionError has not been resolved yet. Then, the Grader Error happened.

Then I tried to open manually the public_test.py in the Coursera notebook system, and “guessing” where could be the cause of my AssertionError comes from.

I am still open to possibility that I miss-interpret the formula of cost function as described in the notebook.

So you are saying that the assertion error you showed is from running the unit tests in the notebook? I thought you were saying that only happened when you tried to run the tests on your own machine.

Are you sure you included both terms of the cost function? Both the Y = 1 and Y = 0 terms?

If you mean that you just copied the code that they gave you in the instructions, that formula is not the whole answer. Compare that to the math formula for the cost and ask yourself two questions:

  1. What happened to the factor of \frac {1}{m}?
  2. What happened to the Y = 0 term?

Yes, I just tried making that mistake and I get the exact same assertion you showed with the same incorrect value. If you take a look again at that section of the instructions, you’ll see that they do mention that what they are showing you is only part of the code you need.

It is unfortunate that making that mistake gives you 0.692xxx instead of 0.693xxx on the first visible test, but note that an error in the 3rd decimal place is way too big to be a mere rounding error. We’re doing 64 bit floating point here, so rounding errors are on the order of 10^{-16}. Even in 32 bit floating point, they are order 10^{-7}.