It’s a good idea to be careful not to modify things like the function definitions that are given to you or the various comments that the grader uses, as you can see in this function defined in the template:
# UNQ_C1 GRADED FUNCTION: sigmoid
def sigmoid(z):
If you modify any of those “UNQ_C?” lines, that can cause this type of error.
One thing to try would be to just get a clean copy of the notebook and then carefully “copy/paste” over just your solutions from the “YOUR CODE HERE” sections.
Let us know if that doesn’t help.