Hi I am trying to finish the zero_pad question in the convolution network step by step programming assignment. I am running into the following error
AssertionError Traceback (most recent call last)
<ipython-input-27-a6f364884ebb> in <module>
12 axarr[1].set_title('x_pad')
13 axarr[1].imshow(x_pad[0, :, :, 0])
---> 14 zero_pad_test(zero_pad)
~/work/release/W1A1/public_tests.py in zero_pad_test(target)
27
28 assert type(x_pad) == np.ndarray, "Output must be a np array"
---> 29 assert x_pad.shape == (5, 4 + 2 * pad, 4 + 2 * pad, 3), f"Wrong shape: {x_pad.shape} != {(5, 4 + 2 * pad, 4 + 2 * pad, 3)}"
30 assert np.allclose(x_pad[0, 0:2,:, 0], [[0, 0, 0, 0, 0, 0, 0, 0],
31 [0, 0, 0, 0, 0, 0, 0, 0]], 1e-15), "Rows are not padded with zeros"
AssertionError: Wrong shape: (4, 7, 7, 2) != (5, 8, 8, 3)
Looking at the error message, I am not sure why the first 1 and the last dimension are different between the expected value and the output. This isn’t something that zero_pad
is doing. Could you please help me resolve this issue?