There are several things that can cause this on that assignment: omitting the stride in the computations for either conv_forward or pool_forward will pass the tests in the notebook, but fail the grader. The stride logic should be the same in both. Since you got 75/100, at least one of those functions must be correct. Coercing the output type of conv_single_step to float32 will also cause a loss of points.
I donât know why the grader here canât at least tell you which functions failed. Weâve complained about this for a long time to the course staff, but apparently this limitation of the grader is hard for them to fix.
Thank you, @paulinpaloalto. In my case, I was converting Z in conv_single_step to float32 which was loosing some accuracy but close enough to pass the test. I changed that to float64 and when Z exactly matches the given value in the test, my grading issue is resolved.
However, the graderâs feedback should at least point to the cell(s) failing the test.
Hi @agneshe, One issue might be related to floating point conversion in conv_single_step. My issue is now resolved after converting to float64 instead of float32.
Yes, sorry, but it is a known problem that the grader doesnât give useful feedback in many cases like this. Weâve asked the course staff about this and apparently it is not so easy to work around the limitations of the Coursera grading platform in these cases.
Just to clarify this misunderstanding:
np.float32 does not cause a loss of accuracy. The issue is that if Z is float64, and you cast âbâ as float32, then when you add them you get an ndarray, not a float. Itâs the type mismatch that causes the error.
Glad to hear you found the solution. Yes, sorry, it is a known problem that the unit tests to not flag that error of omitting the stride. There actually are some values that show as wrong in the stride = 2 test case for pool_forward, but you just have to look carefully to notice. No error message is printed.
A bug has been filed about this for a couple of months at this point.