1only batches of spatial targets supported (non-empty 3D tensors) but got targets of size: : [1, 3,
使用CrossEntropy时常见到如上错误:例如:criterion=nn.CrossEntropyLoss()loss=criterion(logit,target.long())其中,logit:torch.Size([4,31,256,256]);target:[4,256,256,1]就会出现1onlybatchesofspatialtargetssupported(non-empty3