open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
7.68k stars 2.53k forks source link

nn.cross Entropy error #3677

Open anamce opened 1 month ago

anamce commented 1 month ago

If anybody encountered this issue when run swin transformer please let me know I need your guidance

line 3086, in cross_entropy return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing) RuntimeError: only batches of spatial targets supported (3D tensors) but got targets of size: : [2, 512, 512, 3]