zylo117 / Yet-Another-EfficientDet-Pytorch

The pytorch re-implement of the official efficientdet with SOTA performance in real time and pretrained weights.
GNU Lesser General Public License v3.0
5.21k stars 1.27k forks source link

efficientdet-d8.pth RuntimeError: The size of tensor a (11) must match the size of tensor b (12) #484

Closed xzswater closed 4 years ago

xzswater commented 4 years ago

[Info] loaded weights: efficientdet-d8.pth, resuming checkpoint from step: 0

[Error] Traceback (most recent call last): File "train.py", line 228, in train cls_loss, reg_loss = model(imgs, annot, obj_list=params.obj_list) File "/ssd1/zhangsan/2d_detection/obs_2ddetect/pyenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, **kwargs) File "train.py", line 77, in forward , regression, classification, anchors = self.model(imgs) File "/ssd1/zhangsan/2d_detection/obs_2d_detect/pyenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, kwargs) File "/ssd1/zhangsan/2d_detection/obs_2d_detect/EfficientDet/backbone.py", line 73, in forward features = self.bifpn(features) File "/ssd1/zhangsan/2d_detection/obs_2d_detect/pyenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, *kwargs) File "/ssd1/zhangsan/2d_detection/obs_2d_detect/pyenv/lib/python3.6/site-packages/torch/nn/modules/container.py", line 100, in forward input = module(input) File "/ssd1/zhangsan/2d_detection/obs_2d_detect/pyenv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(input, kwargs) File "/ssd1/zhangsan/2d_detection/obs_2d_detect/EfficientDet/efficientdet/model.py", line 190, in forward outs = self._forward(inputs) File "/ssd1/zhangsan/2d_detection/obs_2d_detect/EfficientDet/efficientdet/model.py", line 293, in _forward p7_up = self.conv7_up(self.swish(p7_in + self.p7_upsample(p8_in))) RuntimeError: The size of tensor a (11) must match the size of tensor b (12) at non-singleton dimension 3

xzswater commented 4 years ago

train.py L112 input_sizes = [512, 640, 768, 896, 1024, 1280, 1280, 1536, 1356] modify the last item, 1356 to 1536, solve the probelm.

zylo117 commented 4 years ago

fixed. https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch/commit/fb9cd2466685d530a0860119fe980def35ff33e2#diff-e44f4a60e89e820dde9bb27afa634965