Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xuhan199606 opened this issue Mar 26, 2024 · 1 comment
Open

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

xuhan199606 opened this issue Mar 26, 2024 · 1 comment

Comments

@xuhan199606
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants