I’m having issues converting b into a size one array, I’m just not sure how to do so in exercise 3 of the programming assignment. My error message is as follows:
'---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in
6 “stride”: 2}
7
----> 8 Z, cache_conv = conv_forward(A_prev, W, b, hparameters)
9 print(“Z’s mean =\n”, np.mean(Z))
10 print(“Z[0,2,1] =\n”, Z[0, 2, 1])
in conv_forward(A_prev, W, b, hparameters)
75 weights = W[0,vert_start:vert_end, horiz_start:horiz_end, :]
76 biases = b[:, :, :, c: (c + 1)]
—> 77 Z[i, h, w, c] = conv_single_step(a_slice_prev, w, b)
78
79
in conv_single_step(a_slice_prev, W, b)
25 s = a_slice_prev * W
26 Z = np.sum(s)
—> 27 Z = Z + float(b)
28
29 # YOUR CODE ENDS HERE
TypeError: only size-1 arrays can be converted to Python scalars’