Week 4 Assignment 2 (Application), Exercise 1

I got the following error message, and cannot figure out why?

Cost after iteration 1: 0.6926114346158595
Cost after first iteration: 0.693049735659989
Error: Datatype mismatch.
Error: Wrong shape
Error: Wrong output
Error: Wrong output
0 Tests passed
4 Tests failed

AssertionError Traceback (most recent call last)
in
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)
75 ]
76
β€”> 77 multiple_test(test_cases, target)
78
79

~/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.

If you are returning costs instead of cost, Please click my name and message your notebook as an attachment. Mentors don’t have access to your coursera jupyter workspace. Send the notebook in ipynb format and not in pdf / image format.

Do you have a good reason for hard coding the arguments when invoking initialize_parameters?

1 Like

Woww!! Thanks!!! Everything works out now! I had been checking for hours, hahaha!!!