It’s good to hear that it fixed your problem.
You can have a look at the different loss functions 227. The documentation mentions, what kind of target is expected.
However, it’s sometimes a bit tricky, since for example the BCELoss 157 can be used for multi-label classification (i.e. more than one class is valid for the sample).
For a lot of use cases, you will just need BCELoss, NLLLoss and MSELoss.