huawei-noah / Efficient-AI-Backbones

Efficient AI Backbones including GhostNet, TNT and MLP, developed by Huawei Noah's Ark Lab.
4.07k stars 708 forks source link

GhostnetV3实现插值size不匹配 #258

Closed weixuvg closed 6 months ago

weixuvg commented 7 months ago

代码第274行return out[:,:self.oup,:,:]*F.interpolate(self.gate_fn(res/self.scale),size=out.shape[-1],mode=self.inter_mode) # 'nearest', 当out的h和w不相等时,插值会报错,是不是应该修改为 F.interpolate(self.gate_fn(res/self.scale),size=out.shape[-2],mode=self.inter_mode)

liu-zhenhua commented 6 months ago

是的,可以改成out.shape[-2:]