Course 2 - Week 3 - Exercise 6 error

I keep getting this error and can’t figure out how to solve it

I was also getting the same error.
For me adding one more parameter “from_logits=True” to the categorical_crossentropy worked.

Hi! I tried that and I’m still getting the same error… my code is currently this if that helps:

[code removed]

Thank you for your response!!

The error message shows that variable new_y_train is not defined.

Please verify that you have run the cell where is initialized, is just before section 2.4.

I deleted the code you posted since that is not allowed by the Honor Code.

1 Like

If there’s an error in the cell where new_y_train is defined, this could be the problem.

2 Likes

I have run the cell before 2.4 and I get the same error. Sorry about the code - won’t happen again.

Thank you! I’m a bit confused on how to implement it though when I try shape=(scalar,) I get an error saying “name ‘scalar’ is not defined”.

Hi, @eschal.

It’s just a hint, don’t copy and paste it.

If you assign a scalar value to shape, you’ll get that error.

Let me know if you need more help :slight_smile:

Ahhhh I got it thank you!!!

1 Like