Hello when trying to launch the lab for the C2_W1 Practice Lab I get the following error : " Code Cell UNQ_C3: Unexpected error (NameError(“name ‘A_out’ is not defined”)) occurred during function check. We expected function my_dense_v
to return type <class ‘tuple’>. Please check that this function is defined properly. " What can I do to fix that ?
Welcome to the community!
Comments:
- Please don’t post your code on the Forum. That’s not allowed by the community standards. I can edit your post to remove the code.
- First check whether your code is indented correctly.
thanks
I check my code is indented correctly, that is true
but I don’t know, I get this error!!!
Hi @Fatemeh_Rahmani you can try to follow this approach to solve your issue:
-
Review your code, on the error message it provides you with a guide where the error is, the function
my_dense_v
is not correctly define, so you can explore and check the question and try to think how can you do it differently. -
Watch the lectures again and see if you missed something, usually is a great place to find an answer
-
If you are still stuck you can ask for a hint in the section below the question, try to compare with your answer and implemented yourself, it would give you a great learning opportunity to learn from your mistakes
Hope this helps!
Hi
Thanks a lot
I am confident in my code and all cells are running correctly. But I don’t know why I get this error in the grade section. And the grade of this section is reduced
Ok @Fatemeh_Rahmani You can send me a private message with your code and see if I can help you a little more.
This error because function my_dense_v(A_in, W, b, g): as you didn’t put any thing in A_out(did’t use A_out(the return value))…so
first you should compute z= A_in * w (hete you can use np.matua() to do matrix multiplication)+ b …after that you should computer the result of activation function g(z)
And put the result in A_out
Please feel free to ask any question,
Thanks,
Abdelrahman
Hello @Fatemeh_Rahmani . This error also happened to me because the lines of code were not written exactly below each other.