Incorrect Test Function ? - Exercise 5 - name 'parameters' is not defined

Hi ,
I am facing the following problem in Course 2 - Week 3 Assignment
Test function - forward_propagation_test throws following exception

NameError Traceback (most recent call last)
18 print("\033[92mAll test passed")
—> 20 forward_propagation_test(forward_propagation, new_train)

in forward_propagation_test(target, examples)
1 def forward_propagation_test(target, examples):
2 for batch in examples:
----> 3 forward_pass = target(batch, parameters)
4 assert type(forward_pass) == EagerTensor, “Your output is not a tensor”
5 assert forward_pass.shape == (6, 1), “Last layer must use W3 and b3”

NameError: name ‘parameters’ is not defined

I searched on the forum and there is another thread with similar error - but it seems for him the problem disappeard after the kernel restart 0 but I was surprised with that - for me obviously that did not worked - or executing all paragraphs again in sequnce did not worked

it appears that problem is with test function it self - if I you look carefully at the code - there is no way for test function to know - parameters variable - unless it has to do something with Tensor flow decorators etc. which I am not sure - this parameter shoul dbe ideally the return value of the - initialize_parameters() function and used as such in a test function ,
please clarify …


Solved by @spalande. The cell that initializes parameters had not been run.

Good luck with the rest of the course!

@nramon - Thank You and hope to chat with again … with more intersting topics

1 Like