Course 4 W1 Convolutional Model, Step by Step

Hi,

the grader gives me 0 points because it fails when it tries to run ‘pool_forward_test’

I can’t find this function anywhere in the code but the grader depends on it.
Can you please help me?

Best regards,
Georg

[ValidateApp | INFO] Validating ‘/home/jovyan/work/submitted/courseraLearner/W1A1/Convolution_model_Step_by_Step_v1.ipynb’
[ValidateApp | INFO] Executing notebook with kernel: python3
Success! Your notebook passes all the tests.

The following cell failed:

# Case 1: stride of 1
np.random.seed(1)
A_prev = np.random.randn(2, 5, 5, 3)
hparameters = {"stride" : 1, "f": 3}

A, cache = pool_forward(A_prev, hparameters, mode = "max")
print("mode = max")
print("A.shape = " + str(A.shape))
print("A[1, 1] =\n", A[1, 1])
A, cache = pool_forward(A_prev, hparameters, mode = "average")
print("mode = average")
print("A.shape = " + str(A.shape))
print("A[1, 1] =\n", A[1, 1])

pool_forward_test(pool_forward)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-9-034ff9e73c4d> in <module>
     13 print("A[1, 1] =\n", A[1, 1])
     14 
---> 15 pool_forward_test(pool_forward)

NameError: name 'pool_forward_test' is not defined

The 1st code cell on top of your notebook should have this:
from public_tests import *

public_tests.py is present in the same directory as the notebook if you want to have a look. This file contains the definition of pool_forward_test

Please follow these steps to refresh your workspace if required.

1 Like

Thank you very much the refresh of the workspace solved the problem :slight_smile: