I’m stuck with this error. Either W or a_slice_prev have the wrong shapes (or both).
ValueError Traceback (most recent call last)
<ipython-input-24-7e580406a9e8> in <module>
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]
<ipython-input-23-66e27fad15e2> in conv_forward(A_prev, W, b, hparameters)
84 weights = W[:,:,:,n_C-1]
85 biases = b[:, :, :, n_C-1]
---> 86 Z[i, h, w, c] = conv_single_step(a_slice_prev, weights, biases)
87
88 # YOUR CODE ENDS HERE
<ipython-input-4-74f3183eacc3> 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 + float(b)
ValueError: operands could not be broadcast together with shapes (0,0,4) (3,3,4)
Code:
{moderator edit - solution code removed}