y should be in torch.int64 dtype without one-hot encoding. And CrossEntropyLoss() will auto encoding it with one-hot (while out is the probability distribution of prediction like one-hot format). Segmentation "Long"-"Float" issue

PHOTO EMBED

Wed Jan 05 2022 07:10:13 GMT+0000 (Coordinated Universal Time)

Saved by @rushiraj

y should be in torch.int64 dtype without one-hot encoding. And CrossEntropyLoss() will auto encoding it with one-hot (while out is the probability distribution of prediction like one-hot format)
content_copyCOPY