File ~/mmdetection/mmdet/models/dense_heads/cascade_rpn_head.py:99, in AdaptiveConv.forward(self, x, offset)
96 assert H * W == offset.shape[1]
97 # reshape [N, NA, 18] to (N, 18, H, W)
98 # [1, 16384, 18] -> [1, 18, 16384]
---> 99 offset = offset.permute(0, 2, 1).reshape(N, -1, H, W)
100 offset = offset.contiguous()
101 x = self.conv(x, offset)
RuntimeError: shape '[8, -1, 128, 128]' is invalid for input of size 294912
The offset shape is 1, 128*128, 18 as expected, but it wants to be reshaped to 8, -1, 128, 128 -- where 8 is the batch size. It works okay with a batch size of 1, but with batch size >= 1 the batch size does not seem to broadcast
Prerequisite
Task
I have modified the scripts/configs, or I'm working on my own tasks/models/datasets.
Branch
master branch https://github.com/open-mmlab/mmdetection
Environment
MMCV 3.x, MMDet 2.1.0
Reproduces the problem - code sample
Reproduces the problem - command or script
config='mmdetection/projects/ViTDet/configs/vitdet-cfinet.py' cfg = Config.fromfile(config) cfg.work_dir = osp.join('./work_dirs', osp.splitext(osp.basename(config))[0] + '-cfinet')
runner = Runner.from_cfg(cfg) runner.train()
Reproduces the problem - error message
The
offset
shape is1, 128*128, 18
as expected, but it wants to be reshaped to8, -1, 128, 128
-- where 8 is the batch size. It works okay with a batch size of 1, but with batch size >= 1 the batch size does not seem to broadcastAdditional information
No response