Strange commands

Hello,

I am working on ‘‘convolution_model_step_by_step_v1’’ in week 1 in CNN course. In the jupyter notebook, the code I wrote passed all tests. When I submitted the assignment, I got zero. The error for the first part was ‘‘zero_pad_test(zero_pad) not defined’’. In the second part ‘‘conv_single_step_test(conv_single_step) not defined’’. Can you please guide me to resolve this issue? I don’t even know what ‘’_test’’ is for?

Best regards,
Saleh

Save your notebook.
Then restart the kernel and clear the output.
Then run all of the cells in the Notebook again.
Then check the output cell for each unit test, and verify that you got all the expected results.

Many thanks for your reply. I really appreciate. I did all you advised. Now, I’m getting error in the jupyter notebook. Can you please give me a hint what zero_pad_test(zero_pad) is? What is zero_pad_test?

I really appreciate your help.

Best regards,
Saleh

zero_pad_test() is the unit test for the zero_pad() function.
It runs in its own cell just below the cell with the zero_pad() function.

Be sure you run all of the cells in the notebook, and then again run every cell that you modify.

I follow your instruction, but it says ‘‘name ‘zero_pad_test’ is not defined’’. Is it my mistake or something wrong with the notebook? It’s just the very first step, and I have written only one line of code that I’m sure about…that follows

X_pad = np.pad(X, ((0, 0), (pad, pad), (pad, pad), (0, 0)), ‘constant’, constant_values=0)

Sorry for my repeated questions…I appreciate your help.

Best regards,
Saleh

There’s nothing wrong with the notebook.

You have to run the code in each cell, starting from the top, and proceeding down to the cell you’re working on.

Start at the top, and in each cell, click your mouse and then press to run it.

Or you can use the “Cell” menu to run all of the cells above the one you’re currently working on.

None of this is new to this course, you had the same procedures to use in Courses 1 and 2.

I have done this several times, restarted the kernel, cleared the output, closed the whole coursera page and opened the website again…I have never had such a problem in other Courses. I will try later again. I’m very thankful for your time and care…

Best wishes,
Saleh

Dear Mentor,

The problem is still there. All lines in the code work perfectly fine. When it reaches the autograder, then it blows up. Please take a look…

fig, axarr = plt.subplots(1, 2)
axarr[0].set_title(‘x’)
axarr[0].imshow(x[0, :, :, 0])
axarr[1].set_title(‘x_pad’)
axarr[1].imshow(x_pad[0, :, :, 0])
zero_pad_test(zero_pad) # only this line gives me error. All other lines above work well. Maybe coursera server is not responding. I found the following on google from someone who had the same problem…’‘Even after restarting the kernel, the file would not upload because the server is not responding to the code run in the cell containing the upload widget’’. Does it sound logical to you?

I’m thankful for your time and help. I do appreciate…
Best regards - Saleh