Am getting this error message: AttributeError: ‘list’ object has no attribute ‘shape’. Have looked at the compiler and see that it is a result of x1.shape. Odds are, I am likely doing something wrong. I have a code sample listed below.
# Retrieve values from the first cache (t=1) of caches (≈2 lines)
(caches, x) = caches
(a1, a0, x1, parameters) = caches[0]
# Retrieve dimensions from da's and x1's shapes (≈2 lines)
n_a, m, T_x = da.shape
n_x, m = x1.shape
Any help/assistance/advice that can be given would be greatly appreciated.
x1 is one of the parameters that is in the problem. As can be seen in my first image, x1 is initialized as well as a1, a0, and parameters. This is initialized to caches[0]. Odds are, this snippet of code needs to be adjusted.
That is likely the case. Would it be alright if I posted the code just to show you what I am looking at here? Code will be deleted once a solution is found.
Based on your error log, you are not initializing the gradient with right sizes, So check the previous cell and if you have recalled with the right shape. What I felt you are missing a code work especially related to x1.shape
In case you are not able to get where you could be going wrong, share the grader cell via personal DM.