scnn_pytorch icon indicating copy to clipboard operation
scnn_pytorch copied to clipboard

about init weight of scnn

Open Cverlpeng opened this issue 5 years ago • 7 comments

HI, I want to reproduce the results in your readme.md? but I can't Can you tell me how do you initialize the network weights? conv layers of vgg16 can use vgg16.pth initialize, only load conv2d weight ,not need load other params ?

self.conv6 = nn.Conv2d(512, 1024, 3, padding=4, dilation=4, bias=False)
self.bn6 = nn.BatchNorm2d(1024)     
self.conv7 = nn.Conv2d(1024, 128, 1, bias=False)
 self.bn7 = nn.BatchNorm2d(128)
self.conv_d = nn.Conv2d(128, 128, (1, 9), padding=(0, 4), bias=False)
self.conv_u = nn.Conv2d(128, 128, (1, 9), padding=(0, 4), bias=False)
self.conv_r = nn.Conv2d(128, 128, (9, 1), padding=(4, 0), bias=False)
self.conv_l = nn.Conv2d(128, 128, (9, 1), padding=(4, 0), bias=False)

What initialization method does the convolution of these two parts use? Or the default initialization method

thank you very much! best

Cverlpeng avatar Jun 20 '19 10:06 Cverlpeng

Default initialiation method provided by pytorch is ok.

jcdubron avatar Jun 20 '19 11:06 jcdubron

pytorch提供的默认初始化方法是可以的。

thanks

Cverlpeng avatar Jun 21 '19 01:06 Cverlpeng

Default initialiation method provided by pytorch is ok.

hi, I trained the model to 10 epochs according to the above method, but did not reach the results you announced in the readme, each indicator was 1-2 percentage points worse.

Would you like to ask, are you trained according to the settings in the test.sh file? Can you elaborate on it in detail, how is the model weight initialized? This is very important to me, thank you very much.

Cverlpeng avatar Jun 21 '19 12:06 Cverlpeng

I'm sorry for late. After checking in detail about settings in test.sh, --bg_weight 0.2 should be 0.4. This is indeed my fault. I wish you could obtain a good result and thanks for your feedback.

jcdubron avatar Jun 25 '19 08:06 jcdubron

hi, I used your default test.sh and got total =72.5241, I converted all the parameters in VGG16.pth provided by the official pytorch, including bn.mean of every layer.. Your work is great. thanks But I have a question, have you found that the probmap will appear jagged (wavy), is this the purpose of using extra convolution smoothing in the test phase?

blur = nn.Conv2d(5, 5, 9, padding=4, bias=False, groups=5).to(device)
nn.init.constant_(blur.weight, 1/81)

image

Cverlpeng avatar Jun 26 '19 11:06 Cverlpeng

I have noticed the special pattern and refer to the source code provided by the author. He adds an extra mean filtering when inference so that the visual result gets smoother. I think the jagged pattern is caused by the simple bilinear interpolation which could be improved with more delicate decoder network.

jcdubron avatar Jun 27 '19 01:06 jcdubron

HI,Thanks I tried resnet18/vgg16 to downsample the input image 32 times and directly bilinearly interpolate to the input image size. This is not the case. So I don't know where the problem is. thank you very much!!!

Cverlpeng avatar Jun 27 '19 03:06 Cverlpeng