piwise icon indicating copy to clipboard operation
piwise copied to clipboard

It's different with the standard SegNet

Open deeptoby opened this issue 7 years ago • 9 comments

I think the most contribution in segnet is the idx-maxpooling. you can use the F.max_unpool2d(idx, x) to replace the nn.upsample(). The original upsample can't fit the loss of location information.

deeptoby avatar Nov 21 '18 10:11 deeptoby

Hey, yes that makes sense! Would you mind to send a PR?

On 21. Nov 2018, at 11:07, toby [email protected] wrote:

I think the most contribution in segnet is the idx-maxpooling. you can use the F.max_unpool2d(idx, x) to replace the nn.upsample(). The original upsample can't fit the loss of location information.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

bodokaiser avatar Nov 21 '18 11:11 bodokaiser

yes, i'd like to do that. i have rewrited segnet.i will send it by my pull.

deeptoby avatar Dec 26 '18 10:12 deeptoby

    self.dec1 = features[0: 4]    #[0,3]
    self.dec2 = features[5: 9]    #[5,8]
    self.dec3 = features[10: 16]  #[10,15]
    self.dec4 = features[17: 23]  #[17,22]
    self.dec5 = features[24: -1]  #[24,29]

while there's also a maxpool2d layer after each decoder block in the forward function, I wonder why the pooling operation is implemented twice before unpooling? I haven't run the code just quite confused.

Viarow avatar Feb 04 '19 07:02 Viarow

@Viarow I guess this is a mistake then. Would you mind trying the correct version?

bodokaiser avatar Feb 04 '19 08:02 bodokaiser

I'm actually a novice at deep learning, still trying to understand the codes. I guess it will work right only if the range of pretrained layers are set correct (as shown in the annotations above). I will tell you the results after I try the corrections.

Viarow avatar Feb 04 '19 08:02 Viarow

Hi,there just one pooling at each dec. could you tell me the your found on detail.

deeptoby avatar Feb 04 '19 09:02 deeptoby

If I understood correctly the problem can be found with the index selectors here: self.dec1 = features[0: 4] #[0,3] self.dec2 = features[5: 9] #[5,8] self.dec3 = features[10: 16] #[10,15] self.dec4 = features[17: 23] #[17,22] self.dec5 = features[24: -1] #[24,29]

So for example [0:4] will return [features[0], features[1], features[3]].

As the next layer starts with features[5] the features[4] layer is not used at all.

On 4. Feb 2019, at 10:11, toby [email protected] wrote:

Hi,there just one pooling at each dec. could you tell me the your found on detail.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bodokaiser/piwise/issues/24#issuecomment-460175873, or mute the thread https://github.com/notifications/unsubscribe-auth/ABsq8mP9fvms4uP3e0u5GZhuwdrDC8Tfks5vJ_k6gaJpZM4YsyhR.

bodokaiser avatar Feb 04 '19 09:02 bodokaiser

layer4 is maxpool, it is used later in code in order to get max-index.

deeptoby avatar Feb 04 '19 09:02 deeptoby

Oh I see the point. in the FCN8 model, self.feats = nn.Sequential(*feats[0:9]) self.feat3 = nn.Sequential(*feats[10:16]) self.feat4 = nn.Sequential(*feats[17:23]) self.feat5 = nn.Sequential(*feats[24:30]) are called later in feats = self.feats(x) feat3 = self.feat3(feats) feat4 = self.feat4(feat3) feat5 = self.feat5(feat4) fconn = self.fconn(feat5) which means that some maxpooling layers are also left out in this model?

Viarow avatar Feb 04 '19 09:02 Viarow