C1W4, DNN-Application-local variable 'A' referenced before assignment

what can i do??? :joy:

The problem is that you misspelled “sigmoid”, so it doesn’t match either of the branches in linear_activation_forward.

In terms of how to debug this yourself, the first step would be to examine the logic in linear_activation_forward: that error means you didn’t take either of the conditional clauses. So how could that happen? It must be that your activation value did not match either of the choices, right? This is how debugging works: you start from the point of the error. What does it mean? Then why did it happen? And notice the key point that the bug may not be in the function that “throws”: just as in this case, the code that throws is perfectly correct, but the problem is you passed it a bad argument. So you have to work backwards from the point of the exception to figure out where the real bug is.


:smile:oh,good…thank u a lot

Great! But the key point is not just the solution to your problem: the key point is the second paragraph there. Debugging is part of the job of being a programmer. So next time, don’t just throw up your hands and assume it’s someone else’s job to find the problem. Once you get done with these classes, you won’t have the mentors to back you up, so you need to grow your own debugging skills. That’s an important part of the learning process here. :nerd_face:

1 Like

Thank you very much, professor. I just finished my last assignment. Seeing your reply, your words inspired me again. I will write your words in my diary. I really appreciate it. I hope your career is smooth and your life is happy,thank you!

Congratulations on finishing the course! Best wishes for your future endeavors! Maybe we’ll talk again in the later courses.