C4 W1 Assigment Convolution_model_Step_by_Step_v1: 'numpy.float64' object does not support item assignment


I have implemeted all the functions and casted the b to float using float(b) in conv single step and I cannot understand the error message. Please help. If any further attachments needed to assess the issue, I would be happy to share

{mentor edit: code removed}

{mentor edit: code removed}

I changed the A_prev_pad and used a_prev_pad and sliced it into a_slice_prev. Still i am getting the error

yeah, it’s okay. Thank you.

You should examine how you initialized Z within single_step

My guess is it doesn’t have the proper shape. If it was initialized as a scalar and you tried to assign to a location as if it were multi-dimensional Z[i,w,h,c] it would throw that exception.

2 Likes

Thank you so much. I initialized z as a vector in the forward step but I made a really silly mistake. I initaliazed “z” as a vector not “Z”.

2 Likes

sorry It was due to a silly mistake I made during initialization of Z. The code was not covered in the screenshots I attached.

Thank you I made the same silly mistake and it takes me about one hour to figure out. I really appreciate your post!