In building the 2-layer network, it is showing that the ‘A’ variable is already referenced.
Code starts here:
dA1, dW2, db2,dA0, dW1, db1=linear_activation_backward(dA2, cache2, cache1)
Code Ends
In building the 2-layer network, it is showing that the ‘A’ variable is already referenced.
Code starts here:
dA1, dW2, db2,dA0, dW1, db1=linear_activation_backward(dA2, cache2, cache1)
Code Ends
This is the error:
UnboundedLocalError: local variable 'dA_prev' referenced before assignment.
In python, you have to define a variable before using it.
A perfectly correct function (linear_activation_backward
in this case) can still throw errors if you pass it incorrect arguments. Please take another look at the function signature of that function. The arguments you are passing do not match the definition of the function.