Week 2: Diving deeper into the BBC News archive¶

Good morning, I have a problem when training the neuralnetwork and I would like to know if you can help me. I get the following error:
ValueError: logits and labels must have the same shape, received ((None, 5) vs (None, 1)).

and I think I have all the above well done.
Hope you can clarify this problem.
Thanks in advance,

Please fix the loss function. You should pick the one that allows true labels as integers.

Thank you very much!! problem solved!!

Hello! I have a problem with this asigment.

When I use the loss = (loss=‘categorical_crossentropy’)

I get the error = ValueError: Shapes (None, 1) and (None, 5) are incompatible

but when I change it to sparse_categorical_crossentropy the error disapears.

Why is that?

Please see this

problem solved, thank you a lot! one more question,

if i wanted to make predictions with the model how would i do it, because im trying with model.predict(padded sequence example)

and its giving me arrays of different lenghts

You’re welcome. Please click my name and message your notebook as an attachment.