TommyZihao / MMSegmentation_Tutorials

Jupyter notebook tutorials for MMSegmentation
518 stars 87 forks source link

RuntimeError: stack expects each tensor to be equal size #13

Open xuhan199606 opened 7 months ago

xuhan199606 commented 7 months ago

File "/media/hanxu/Documents/Paper003-underwater-segmentation/mmsegmentation-1.1.2/mmseg/models/segmentors/encoder_decoder.py", line 178, in loss loss_decode = self._decode_head_forward_train(x, data_samples) File "/media/hanxu/Documents/Paper003-underwater-segmentation/mmsegmentation-1.1.2/mmseg/models/segmentors/encoder_decoder.py", line 139, in _decode_head_forward_train loss_decode = self.decode_head.loss(inputs, data_samples, File "/media/hanxu/Documents/Paper003-underwater-segmentation/mmsegmentation-1.1.2/mmseg/models/decode_heads/decode_head.py", line 262, in loss losses = self.loss_by_feat(seg_logits, batch_data_samples) File "/media/hanxu/Documents/Paper003-underwater-segmentation/mmsegmentation-1.1.2/mmseg/models/decode_heads/decode_head.py", line 305, in loss_by_feat seg_label = self._stack_batch_gt(batch_data_samples) File "/media/hanxu/Documents/Paper003-underwater-segmentation/mmsegmentation-1.1.2/mmseg/models/decode_heads/decode_head.py", line 289, in _stack_batch_gt return torch.stack(gt_semantic_segs, dim=0) RuntimeError: stack expects each tensor to be equal size, but got [1, 320, 320] at entry 0 and [1, 339, 320] at entry 2

遇到了这个错误请问如何解决

LuLu2kANG commented 4 months ago

datapipeline有问题,说实在的,openmmlab的文档等于一坨翔