Open H-WU opened 3 years ago
谢谢你的发现
当替换分组卷积时,weight的维度和group的维度不对应。
RuntimeError: Given groups=1024, expected weight to be at least 1024 at dimension 0, but got weight of size [32, 32, 3, 3] instead
aggregate_weight = torch.mm(softmax_attention, weight).view(-1, self.in_planes, self.kernel_size, self.kernel_size)
这一行应改成下面这样aggregate_weight = torch.mm(softmax_attention, weight).view(-1, self.in_planes//self.groups, self.kernel_size, self.kernel_size)
MobileNetV2替换动态卷积的结果你测了吗 我这边测试有较大的下降
当替换分组卷积时,weight的维度和group的维度不对应。
RuntimeError: Given groups=1024, expected weight to be at least 1024 at dimension 0, but got weight of size [32, 32, 3, 3] instead
aggregate_weight = torch.mm(softmax_attention, weight).view(-1, self.in_planes, self.kernel_size, self.kernel_size)
这一行应改成下面这样aggregate_weight = torch.mm(softmax_attention, weight).view(-1, self.in_planes//self.groups, self.kernel_size, self.kernel_size)