I don’t know where is the problem. In def conv_forward(A_prev, W, b, hparameters), I got result as followed:

First Test: Z’s mean is incorrect. Expected: 0.5511276474566768

Your output: -2.5890616106661946

First Test: Z[0,2,1] is incorrect. Expected: [-2.17796037, 8.07171329, -0.5772704, 3.36286738, 4.48113645, -2.89198428, 10.99288867, 3.03171932]

Your output: [1.36532492 1.36532492 1.36532492 1.36532492 1.36532492 1.36532492

1.36532492 1.36532492]

in another function, def conv_backward(dZ, cache):, I got the result as following:

100 #Convolve the (3D) slice with the correct filter W and bias b, to get back one output neuron. (≈3 line)

→ 101 weights = np.sum(a_slice_prev*W[ :, :, :,i-1])

IndexError: index 8 is out of bounds for axis 3 with size 8

I am not sure where is the problem, I have checked the stride and thought it has been correctedly used.