Course 1,Week 2 Programming assignment: problem with model_test

Hello,

I got an assertion error in model_test. However, if I print the value of w at the end of my code, the value is as expected. Please see below my code and copy of the output .
Please advise


(1, 7)
(4, 1)
(1, 7)
(4, 1)
[[ 0.08639757]
[-0.08231268] ** Output from print(params[“w”])**
[-0.11798927]
[ 0.12866053]]

AssertionError Traceback (most recent call last)
in
1 from public_tests import *
2
----> 3 model_test(model)

~/work/release/W2A2/public_tests.py in model_test(target)
121 assert type(d[‘w’]) == np.ndarray, f"Wrong type for d[‘w’]. {type(d[‘w’])} != np.ndarray"
122 assert d[‘w’].shape == (X.shape[0], 1), f"Wrong shape for d[‘w’]. {d[‘w’].shape} != {(X.shape[0], 1)}"
→ 123 assert np.allclose(d[‘w’], expected_output[‘w’]), f"Wrong values for d[‘w’]. {d[‘w’]} != {expected_output[‘w’]}"
124
125 assert np.allclose(d[‘b’], expected_output[‘b’]), f"Wrong values for d[‘b’]. {d[‘b’]} != {expected_output[‘b’]}"

AssertionError: Wrong values for d[‘w’]. [[0.]
[0.]
[0.]
[0.]] != [[ 0.08639757]
[-0.08231268]
[-0.11798927]
[ 0.12866053]]

Hi @Igor_Sheinman,

Can you share your lab ID with me ? In the assignment, when you click the top right “Help” button, a panel will open and your lab ID will be shown at the bottom.

I shall take a look.

Thanks,
Mubsi

Hi @Mubsi
Here is my labID: ccewgytc
I removed print and submitted - got 83 because of this cell

Thanks
Igor

Can I know what’s the problem is as I also meet the same thing?

Hi @JUNHAO_ZHANG,

Can you share your lab ID ?

Thanks,
Mubsi