d-li14 / PSConv

[ECCV 2020] PSConv: Squeezing Feature Pyramid into One Compact Poly-Scale Convolutional Layer

Home Page:https://arxiv.org/abs/2007.06191

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't simply replace nn.Conv2d with PSConv2d

quantumsquirrel opened this issue · comments

Thanks to the compact characteristic of PSConv, just replace nn.Conv2d with PSConv2d. Note that there exists another hyperparameter named parts you may set in our PSConv operator.

Originally posted by @d-li14 in #3 (comment)

Hi, I'm reading your paper and there comes some problems, hope you could help me figer it out!
Origin Conv2d was
Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
PSConv2D are
PSGConv2d( (gwconv): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=4, bias=False) (gwconv_shift): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2), dilation=(2, 2), groups=4, bias=False) (conv): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False) )
And I add
self.weight = self.conv.weight self.bias = self.conv.bias
To solve the problem
" 'PSGConv2d' object has no attribute 'weight' " during building Resnet,
I don't know I'm right or wrong but it works temporarily.
After that ,durning training part,in PSConv2d.forward
self.gwconv(x).shape:
torch.Size([6, 256, 202, 274])
self.conv(x).shape
torch.Size([6, 256, 202, 274])
but x_shift.shape:
torch.Size([6, 256, 204, 276])

So....The size of tensor a (274) must match the size of tensor b (276) at non-singleton dimension 3

I'm using FCOS original code from tianzhi0549,thanks for the contribution, and add "psconv.py | conv_module.py | conv_ws.py " norm.py" from this respository.

Thank you for your time!

I think there is few mistake in the code, try to change 'dilation' to 'padding'!
image

I think there is few mistake in the code, try to change 'dilation' to 'padding'! image

你好,请问图片中的这段核心代码怎么理解呢?方便解释一下吗?
image