ssd_pytorch icon indicating copy to clipboard operation
ssd_pytorch copied to clipboard

关于l2norm中的 out = self.weight.unsqueeze(0).unsqueeze(2).unsqueeze(3).expand_as(x) * x

Open lwdoubles opened this issue 5 years ago • 1 comments

这里为何要用unsqueeze呀

lwdoubles avatar Jul 28 '19 07:07 lwdoubles

这里为何要用unsqueeze呀

请问您是否遇到过 File "D:\code\2020.5.22code\SSD_iresnet\layers\modules\l2norm.py", line 23, in forward out = self.weight.unsqueeze(0).unsqueeze(2).unsqueeze(3).expand_as(x) * x RuntimeError: The expanded size of the tensor (128) must match the existing size (512) at non-singleton dimension 1. Target sizes: [1, 128, 150, 150]. Tensor sizes: [1, 512, 1, 1]这样的问题呢

HXH-resonance avatar May 24 '20 01:05 HXH-resonance