Week 1 - Assignment 3 - forward_propagation_test not defined


Despite having restarted the kernel, rerun all the cells, I keep getting the following error “name ‘forward_propagation_test’ is not defined”.

This keeps blocks my result to 60% despite the fact that all the other cells run without problems and I was able to identify the two bugs with the gradient checking.

Any clue ?

Hi @rasugo,

It might be possible that you had forgotten to run the cell corresponding to that cell that contained the definition. Do check if that is the case and run it once more just to be sure!

Dear @thearkamitra
Thanks for the feedback. I have tried:

  • shutdown & restart kernel, running all the cells from the beginning of the notebook,
  • shutdown, restart kernel & clear output

None the less, I keep getting the error.

Are you running in your local machine?
If so, are all files included?

Hi @rasugo,

I believe that the function forward_propagation_test is defined in the file public_tests.py, so make sure that you run the first code cell of the notebook, the one with the following content:

import numpy as np
from testCases import *
from public_tests import *
from gc_utils import sigmoid, relu, dictionary_to_vector, vector_to_dictionary, gradients_to_vector

%load_ext autoreload
%autoreload 2

Dear @thearkamitra, I am running on the web.
Dear @kampamocha, I am running the cell you highlighted always as first.

Hi @rasugo,

Are you using the Coursera platform? I am not sure why this is happening. If you have the file, this error should not have popped up. If you can, could you open public_tests.py and check if the definition is present?

Hi @thearkamitra
I was in the middle of no where with no internet access…
The definition seems to be present, here are the first lines of code of public_tersts.py.

Hi @thearkamitra , @kampamocha

Update After opening the public_tests.py file … I finally got my “pass”
It finally worked ?!?!?!