Week-1 Exercize-3 conv_forward

Hi, I am facing the below error. Not able to get how to resolove. Can anyone help me with this?


ValueError Traceback (most recent call last)
in
6 “stride”: 2}
7
----> 8 Z, cache_conv = conv_forward(A_prev, W, b, hparameters)
9 z_mean = np.mean(Z)
10 z_0_2_1 = Z[0, 2, 1]

in conv_forward(A_prev, W, b, hparameters)
89 weights = W[:,:,:,c]
90 biases = b[:,:,:,c]
—> 91 Z[i, h, w, c] = conv_single_step(a_slice_prev, weights, biases)
92 # s = np.multiply(a_slice_prev, W)
93 # Z = np.sum(s)

in conv_single_step(a_slice_prev, W, b)
23 # Z = None
24 # YOUR CODE STARTS HERE
—> 25 s = np.multiply(a_slice_prev, W)
26 Z = np.sum(s)
27 Z = Z + np.float64(b)

ValueError: operands could not be broadcast together with shapes (2,3,4) (3,3,4)

I’d guess that a_slice_prev is the wrong size.

Right and the place to look for the bug is in your conv_forward logic. There must be something wrong with how you are managing the loops and the stride there. Note that the loops are all over the output space and you must not skip any positions there. The striding happens in the input space.