W4_Ex-4_Tests failing

Hello @tfu, I have exactly the same behavior as your image|690x437

But replacing layers_dim with the three dimensions as an array(list) did not change anything for me. I bump into the “2 Tests passed, 1 Tests failed” with “Error: Wrong output for variables W1,b1,W2,b2 and 0”…

My problem output (as text, seems identical to image|690x437 ) is:

Cost after iteration 1: 0.6564026188409187
Cost after first iteration: 0.6950464961800915
Cost after iteration 1: 0.7239781229671559
Cost after iteration 1: 0.7239781229671559
Cost after iteration 1: 0.7239781229671559
Error: Wrong output for variable W1.
Error: Wrong output for variable b1.
Error: Wrong output for variable W2.
Error: Wrong output for variable b2.
Error: Wrong output for variable 0.
2 Tests passed
1 Tests failed
---------------------------------------------------------------------------
AssertionError -------------------- Traceback (most recent call last)
<ipython-input-32-f9ec5304d38d> in <module>
-—| 3 print("Cost after first iteration: " + str(costs[0]))
-—| 4
-—> 5 two_layer_model_test(two_layer_model)

~/work/release/W4A2/public_tests.py in two_layer_model_test(target)
-–| 54 ]
-–| 55
- → 56 multiple_test(test_cases, target)
-–| 57
-–| 58

~/work/release/W4A2/test_utils.py in multiple_test(test_cases, target)
–| 140 print(‘\033[92m’, success," Tests passed")
–| 141 print(‘\033[91m’, len(test_cases) - success, " Tests failed")
→ 142 raise AssertionError(“Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.”.format(target.__name__))
–| 143

AssertionError: Not all tests were passed for two_layer_model. Check your equations and avoid using global variables inside the function.

Note: the “cost” @tfu and I obtained on “first” iteration indicated on this post: https://community.deeplearning.ai/t/week-4-exercise-4-not-passing-both-tests/11880

(hence iteration 0) seems the same as other people indicated on post https://community.deeplearning.ai/t/course-1-week-4-programming-assignment-2/5587

although @michael.brent seems to have obtained
a different iteration 0 cost 0.6930497356599888 on Post#6 May 23, 1:03 PM

although also @tfu may have obtained
a different iteration 0 cost ??? on Post#3 Jun 4, 5:31 PM

1 Like