C2_W2 Assignment; Cell #2 NameError("name 'my_softmax' is not defined")

Hello, the grader repeats a 0 even though all my tests passed, and returns the following message:

Cell #2. Can't compile the student's code. Error: NameError("name 'my_softmax' is not defined")

As shown below, the “Cell #2” is just a note where any student cannot edit, let alone writing any student’s codes.

In my thinking, the NameError occurs simply because “my_softmax” is defined in the Cell #4 which appears later on in Exercise 1. Actually, if I run Cell #3 and Cell #4 before running Cell #2 on issue, the unit test is passed successfully without any error.
However, even if I submit Assignment in this manner, the grader verifies my assignment along the original sequence cell order in any which ways, making the grader returning the above error message.

Can anyone help me to resolve this problem? Thanks in advance.

Every time you open the notebook, you must run all of the cells starting from the first one at the top of the notebook.

This is where the packages are imported and the data set is configured.

There is a menu option “Cell” → “Run All” to make this easy.

If you do this and still have a problem, please post back again.

Also, some tips:

  • Never run the cells out-of-order. Start at the top and work your way to the bottom.
  • Never add any new cells.
  • Never delete any cells.
  • When you edit anything in a cell, go back and run all the cells again from the top.

Thanks, Tom. I fully understand what you said. However, in my posted case, I always stuck in Cell #2, which is almost beginning, and cannot control it by myself.

Sorry, but I do not understand what is in your notebook.
Here is what mine looks like:

Hello Shinya,

make sure you recalled

ez =
a =

with the right numpy from the previous grader cell where you have encountered this error.

Check in the hints which is below the grader cell. at the bottom it explains how to def my_softmax

The grader cell requires only 2 lines codes.

Hope this helps!!!

Regards
DP

Tom your notebook and her notebook is perfectly fine, there is issue in her code.

I am puzzled. Section 2 of my notebook looks totally different.

looks like your grader cells are not seen, check if it is updated lab?

Yes, Tom. I’m also puzzled. Mine is as below.

Thanks, Deepti. I think if I had Tom’s notebook, this problem would have not occured.

Shinya,

Then the best next step would be getting the latest version of the notebook assignment.

I hope you know how to update the assignment notebook.

Click Help=== Get the latest version ====update lab.

If the lab still shows the older version then let me know.

Regards
DP

Oh thanks. However, I’m now relying on you after I did my best in my lab, which I have attempted to update my lab but the latest note being always like the screenshot I posted.

ok then next you do this

Click file, then open, here you will see the notebook assignment. Select that and delete it. Now you will find 404 error.

At this time, click help, then click reboot.

Once reboot is done, click help again, click Get Latest Version and then update lab.

With this you will surely have the latest notebook version.

Let me know if still have issue.

Following your instruction excactly, I finally sucessfully obtained the correct latest lab. I am sure I can proceed the course! I really appreciate your kind help!

are you able to see the grader cells?

1 Like

Yes, every thing looks perfect! Thanks again!!