Hi,
I am getting “Index Error: too many indices for array” in Exercise 3 - attached the screenshot below.
I verified the shapes of below variables. Requesting your help. Thanks.
A_prev is (2, 5, 7, 4)
W is (3, 3, 4, 8)
A_prev_pad is (2, 7, 9, 4)
n_C_prev is 4
a_slice_prev is (3, 3)
weights is (3,3)
biases is (1, 1, 1)
Hello @trelango,
Judging from the traceback, it seems to be complaining about Z[i, h, w, c]
that using 4 indices is too many for Z
.
Now, it is a part of the exercise that we need to # Initialize the output volume Z with zeros. (≈1 line)
. Did you initialize Z
properly to a 4-D array?
Raymond
I have wrongly initialized Z with the shape (3, 4) and it is now corrected. I am facing different issue and working on it. Thanks a lot for your support Raymond.
can someone point out where am I going wrong?
The shape of Z
is:
Z -- conv output, numpy array of shape (m, n_H, n_W, n_C)
Also, you may find this post helpful.
Thank you @saifkhanengr for tagging that post, it is helpful but I am getting a different error even after I follow that post
Help!!
Please send me your code in a private message. Click my name and message.
There are many bugs in your code. You missed the stride part when calculating vertical and horizontal start and end. Even if you correct this, still you will face some error. So, I request to read the post I linked previously again, and again. That post’s instruction would be suffice to pass this exercise, provided that you read it carefully and pay attention to every details.
1 Like
I have gone through the entire post thoroughly and re-written everything exactly following the steps given there still getting the following error
should I go ahead with this error?
It Worked, I had followed all the instructions that were given and the additional information was I did not know how to mention all in python programming language and also for float errors I used int() to get rid of the error.
Thanks a lot to @saifkhanengr for helping me out with this
1 Like