Res2Net/Res2Net-PretrainedModels

dimension not match error in res2net_dla60

Closed this issue · 1 comments

File "C:/Users/Administrator/PycharmProjects/PSENet/models/res2net_dla.py", line 261, in forward
    x1 = self.tree1(x, residual)
  File "D:\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "C:/Users/Administrator/PycharmProjects/PSENet/models/res2net_dla.py", line 261, in forward
    x1 = self.tree1(x, residual)
  File "D:\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "C:/Users/Administrator/PycharmProjects/PSENet/models/res2net_dla.py", line 103, in forward
    out += residual
RuntimeError: The size of tensor a (38) must match the size of tensor b (37) at non-singleton dimension 3

dimension is changed in line 89, is there any thing wrong with self.convs?

I found that change line 247 to self.downsample = nn.MaxPool2d(stride, stride=stride, ceil_mode=True) will fix it.