Description
I am working on the programming assignment for week 2, I have done the first Exercise and I am on the second exercise though I have finished the second exercise too (random_mini_batches) and it has passed all the first tests in the first test frame but the second test in the second frame (random_mini_batches_test) is failing without any useful error messages so I don’t know where the error is in the code, so my question is how do I further debug the second test frame to know where the error is and what I am not doing well in the random_mini_batches function.
this is the output of the second test
1 Tests passed
2 Tests failed
...
AssertionError: Not all tests were passed for random_mini_batches. Check your equations and avoid using global variables inside the function.
Which of those values are failing? Try working backwards to identify where your code is going wrong. Use some print statements to output values that you are calculating and check if those are expected and if not how can you fix it.
thanks for your quick response, I have tried them and I have also printed out values that may be helpful but they didn’t give me a clue of what is wrong
You can read the details of that test by using the File menu to open the public_tests.py file. That’s where the random_mini_batches_test() function is defined.
You can look at the specific data that test is using, and use that information to investigate how your code works for those conditions.
I have checked the random_mini_batches_test() function in the file and the expected output, I have updated the code and the output of the second test case is now matching the first item in the expected output list but it is still giving me the same error
AssertionError: Not all tests were passed for random_mini_batches. Check your equations and avoid using global variables inside the function.