CrossEntropyLoss() Error

I’ve been working on a semantic segmentation task in point clouds, with RandLA-Net.
I’m trying to train the network on the DALES dataset, which is 8 labels semantic segmentation dataset, while doing so, I’ve got the following error:

Now, when I searched online I found that it might be triggered due to the difference between the logarithm distributed scores shape, and the labels shape. when printing the shapes of them I’m getting the following:


 scores = model(points)

 logp = torch.distributions.utils.probs_to_logits(scores, is_binary=False)


and the output is:

torch.Size([1, 8, 40960])
torch.Size([1, 40960])

I’ve been struggling to understand if the shapes are incorrect, and how to fix them, will appreciate any help.
Thanks in advance.

Anyone? Still struggling to solve this issue. Thanks

Could you rerun the script via:


and post the stack trace here?
Alternatively, run the code on the CPU and post the complete stack trace.

1 Like