Code is correct but zero grade (Emojifier)

I get the error by the autograder:

“Cell #12. Can’t compile the student’s code. Error: TypeError(“unsupported operand type(s) for +=: ‘int’ and ‘NoneType’”,)”

Help appreciated.

Thank you

Note that you cannot grade a partially-complete notebook. Any “None” statements in the notebook will cause the grader to crash.

1 Like

Dear both,

Thank you for your replies, but a first problem is identifying which is the cell where the problem occurs. Cell #12 has the following code provided by the grader:

"
Y_oh_train = convert_to_one_hot(Y_train, C = 5)
Y_oh_test = convert_to_one_hot(Y_test, C = 5)
"

I don’t see any += sign.

Thank you once again.

Which course are you attending?
Which week and assignment in that course?
Did you post your question in the correct Discourse forum?

FYI, the grader counts the program cells in the notebook starting from 1 at the top of the file.

Dear both,

Thank you both for your feedback. In reply:

  1. convert_to_one_hot - No I did not write this function
  2. This is the 2nd assignment of Week 2 of Course 5 (Sequence Models)

Worth mentioning that whilst I was completing the assignment, this had slight changes from the course organizers and I submitted the version of the code saved by coursera and that I had been working since the beginning.

Thank you for your help once again.

Hi @AntonioMaher ,

It looks like the execution environment is out of sync. Refresh the kernel and rerun the code from start should help:

from the top of the notebook’s menu bar:
Kernel → restart and clear all output
Cell → run all above ( from you current cell)

If your notebook has been inactive for a period of time, you need to rerun the code. Each time when you login to a work on your notebook, it is good to rerun your code because Python is an interpreter. The way it works is different from compiled code.

Hi Kic,

Thanks for your help.

I did what you suggested but it did not work. Please bear in mind that the problem is in the submission and not in the code.

It is still zero graded.

Best regards

Hi @AntonioMaher ,

I was responding to your first post where the error output is about the ErrorType and you gave us those lines of code in that cell.

I am sure by now, you know submission can only be done after all the unit tests are passed.
If it helps, send me you notebook in a DM, I will have a look for you.

Hi @AntonioMaher ,

There are a couple of errors found in your code for the model() function:

  1. when calculating the loss, it is log(a) to be used, not a . Please see the formula in the implementation instruction.
  2. When computing the gradient, dw should not be the cumulation of the previous dw. So remove the summing of dw. And the same with db as SGD parameter update is per example.

Thank you Kic.

Have done the corrections, but now I am running into other problems!

Not to overload you, I will post it to everyone.

Dear all,

When submitting, I now get the following message:

Failed to execute submission request: HTTPSConnectionPool(host=‘hub.coursera-apps.org’, port=443): Max retries exceeded with url: /api/workspaceSubmissions.v1?action=createBatch (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7f30fae8fe50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’))

Thank you for any help possible.

Hi @AntonioMaher ,

There have been other learners experienced similar problem lately, but it was resolved when they tried the submission again later.

Please let’s know if the problem still persists after retry.

Dear all,

Thanks for the feedback Kic.

Still get the message:

Failed to execute submission request: HTTPSConnectionPool(host=‘hub.coursera-apps.org’, port=443): Max retries exceeded with url: /api/workspaceSubmissions.v1?action=createBatch (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7f4eb1c22d50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’))

Will try tomorrow again.

Cheers,
Antonio

Hi @AntonioMaher ,

Could you check if there is another copy of the same assignment running. From the top of the notebook menu bar, click:
file ->open
You will see a green notebook sign next to the file that is running. It should be Emoji_3a.ipynb
That should be the file where you made the correction.
To make sure everything is working, refresh the kernel and rerun the code:
Kernel → restart and clear all output
Cell → run all

Hi @AntonioMaher

Great to hear everything is working fine now.

Thanks a million for that!