1only batches of spatial targets supported (non-empty 3D tensors) but got targets of size: : [1, 3, 375, 1242]

Oh, I fix the problem. According to the documentation, the size of the input of function torch.nn.functional.cross_entropy should be (N,C,H,W). CHANNEL FIRST :sweat_smile:

2 Likes