Course 1, week 4, assignment 2 , exercise 4

I have applied the code in shell for getting Two- layer Neural Network. The code was OK, but still I am getting error of :

ValueError: too many values to unpack(expected 2)

I have tried many times to correct it, and consult to many, and come to a point that the problem is in test code, but test code is not editable.

Please provide me your helpful suggestions.

Hi @Akkshit
The hint is to follow the comments about what to do in the exercise and pay attention to variables with indexes that increases during forward and decreases with backward. Also the correct activation sequence.
Please you can post the screenshot of the error so we can check where the error is occurring.
Keep learning!

Sir I have go through the entire code , but didn’t get my mistake.

I am sharing screenshots of code as well as output error.

Please mention my mistake so that I can make my mistake correct.


Hi @Akkshit
It seems you are using an out of date notebook. Note that before enter the notebook page, there is a note about how to “refresh the workspace” to get your workspace updated. Just take care to backup your job but you will find all the instructions in the mentioned link.
Keep learning!

Thankyou so much sir, I have clear the assignment as well as course. If you haven’t told me to refresh the page then I will never gonna clear the assignment.
Once again thankyou soo much sir.


I am facing a similar situation to Akshit’s. All 4 tests for Exercise 4 have failed.
I cannot find anything wrong with my code. (BTW, Akshit’s code is still viewable)

And I noticed that shows the expected values as follows:

 expected_parameters = {'W1': np.array([[ 0.01624965, -0.00610741, -0.00528734, -0.01072836,  0.008664  ,
                                 -0.02301103,  0.01745639, -0.00760949,  0.0031934 , -0.00248971],
                                [ 0.01462848, -0.02057904, -0.00326745, -0.00383625,  0.01138176,
                                 -0.01097596, -0.00171974, -0.00877601,  0.00043022,  0.00584423],
                                [-0.01098272,  0.01148209,  0.00902102,  0.00500958,  0.00900571,
                                 -0.00683188, -0.00123491, -0.00937164, -0.00267157,  0.00532808],
                                [-0.00693465, -0.00400047, -0.00684685, -0.00844447, -0.00670397,
                                 -0.00014731, -0.01113977,  0.00238846,  0.0165895 ,  0.00738212]]),
                         'b1': np.array([[ 1.10437111e-05],
                                [ 1.78437869e-05],
                                [ 3.74879549e-05],
                         'W2': np.array([[-0.00200283, -0.00888593, -0.00751122,  0.01688162]]),
                         'b2': np.array([[-0.00689018]])}

But the initialize_parameters(n_x,n_h,n_y) initializes the b1 and b2 vectors to all zeros.
Am I missing something?
I updated the lab to the latest version.
I looked through my code, and I don’t see anything wrong to fail all 4 tests.
Appreciate it if you can provide any guidance.
My lab id: vkfxvwem