I’m here to get help with an error that occurs in C4:W1:A1: Ex 3: conv_forward(A_prev, W, b, parameters). It is returning Z having 4 ranks because it is Z[i,h,w,c]=something in the function. I put Z[i,h,w,c]=conv_single_step(a_slice_prev, weights,biases). In the test trunk, there is z_0_2_1 = Z[0, 2, 1]. This gave the error as: IndexError: index 2 is out of bounds for axis 1 with size 1.

I may have missed something. Can anyone help me with this problem? Thanks ahead!

Thanks for the quick reply. I checked stride, h, and w and I found that I have used stride in range, that’s not right. I corrected the range and the shape of Z is correct now.