Cross entropy loss

cross entropy loss giving error in week 1 course 4 assignment:

File “”, line 21
loss_layer= tl.CrossEntropyLoss()
SyntaxError: invalid syntax

Hi @Aimen_Malik,

It would be helpful for the mentors to share what your error is so that they can better help you.


take a look again at the error now

Hi @Aimen_Malik,

You have a syntax error in the line that is before loss_layer= tl.CrossEntropyLoss()

1 Like

I suspect the line code is missing the comma sign - “,”

Hope it helps.