Week4 Exercise 9 KeyError

The output didn’t show and it shows KeyError for ‘dA1’
Any guidance would be appreciated. Thanks

This means that you do not have the key ‘dA1’ in the dictionary ‘grads’. And, if you look at the whole logical path, you did not set any key/value into the ‘grads’ dictionary yet.
As you see, this routine is calculating gradients, dAx, from the end. And, the number of the layers is “L”.
You should remember that you set the gradient of the last layer already. Please select an appropriate variable.

1 Like