Submission error in C1_W3_Logistic_Regression

I am getting the following error:
Cell #14. Can’t compile the student’s code. Error: TypeError(“unsupported operand type(s) for +=: ‘NoneType’ and ‘NoneType’”)

What does cell # refer to (I do not have a cell #14? Is is the 14th code cell? when I execute by running each individual cell, the code works well. The submission is failing. Any advice to resolve this?
Ravi

Hello Ravi,

These grader cells comes with template and you only need to replace the None with the codes.

#14 might be the code line.

if you notice in the error log it shows +=: but it should be += so the type error

Regards
DP

The issue is resolved. I was working on my copy of the file. Once I update the assignment copy, everything worked fine.

Were you working on the copy of your file on local system/jupyter lab?

im having the exact same issue, how can this be resolved

Often, errors about “NoneType” mean you’re trying to grade a notebook that has incomplete assignments.

I am also having issues completing this course, all tests say passed, but grading shows an error in cell 14 and shows a syntax error. When comparing with others issues I’ve seen online, mine seems to show “initial_b = 0.and” and I cannot remove the “and” that seems to be causing the issue. I’ve attempted to restart the session, restart the kernel and clear all cells, and continue to run into this error. Please assist with this. Thanks!

Note that the image you posted is from one of the notebook tests, which is throwing the syntax error. So your statement "“all tests say passed” is not true.

The ‘and’ should not be there at all. initial_b is a scalar floating point value. Somehow that cell has been modified.

What platform are you using the the course (the DL.AI Learning Platform or Coursera)?
Once I know that, i can check the appropriate repo and see if has the same error.

The repo for Coursera has this: It’s correct.

And here is the code used on the DL.AI Learning Platform. It is also correct.

So I think you have two options:

  • Delete your notebook and get a fresh copy, and start over. How you do that depends on what platform you’re using.

  • Or, you can use the instructions at the bottom of the notebook that tell you how to unlock a cell you can edit it. Then you can delete the incorrect “.and” text.

Hey @TMosh , thank you for your help, editing the metadata to remove the “and” got everything to work and grade properly. What I meant by all tests passed, was any cells that say that after running all were passed where edits were needed. I am currently running in Safari on a Mac running Tahoe (26.3.1), if that helps any. Very odd that the uneditable cell would have that added to it, but again, thanks for the assist and have a great day!

Sometimes this happens, and we’ve never been able to pin down exactly how.