C5W1A3 - djmodel - NameError: name 'model' is not defined

I finished the code for djmodel function but this error appears when running # UNIT TEST

What’s wrong with the model? Please help me. Thanks

1 Like

Try restarting the kernel and running all of the cells again.

1 Like

I did but it doesn’t work

1 Like

Try restart the kernel

1 Like

I restarted so many times but it doesn’t help

1 Like

Perhaps you have a different problem.
Did you modify the names of any functions in the notebook?
Did you add any cells?
Did you modify any cells that you weren’t supposed to?

2 Likes

I refreshed my workspace from the beginning and it worked. I found that this line of code disappeared in the previous workspace: model = djmodel(Tx=30, LSTM_cell=LSTM_cell, densor=densor, reshaper=reshaper)

Many thanks

1 Like

I have the same issue. The first exercise used to work with “all tests passed” but now it’s not working anymore. I have refreshed and restarted and rerun. I’m getting these messages.
What can I do?
image

1 Like

The syntax error is probably in the notebook on the lines before the one where the ‘invalid syntax’ error is shown.

This is because the parser can only report a syntax error after it reads your code and realizes it doesn’t make sense. It has no idea where the error is, just where it detected a problem.

Maybe you accidentally modified some of the previous code.

1 Like