NBA_prediction --> RuntimeError

Hi, everyone. I’m new to pytorch, and also i’m an asian, so forgive my poor English~
I was trying to build a net to predict the NBA competition outcome of each game, but
when i build the net, it always give me the same error like :“RuntimeError: already counted a million dimensions in a given sequence. Most likely your items are also sequences and there’s no way to infer how many dimension should the tensor have”. is it the problem of my input data dimension? please direct me, thanks!!

There are a few bugs in your code.
The CrossEntropyLoss combines LogSoftMax and NLLLoss in one single class. Since you are using sigmoid as your output activation, you should probably use BCELoss.

Also, you reassign loss in your loop. You could rename the loss function to criterion.

Hope this helps!

1 Like

Thank you, i solved my problem immediately!!