From b7cbf5a5ae8b3197ce9117f8fc64e0324bce4b3b Mon Sep 17 00:00:00 2001 From: jfzhang95 Date: Sat, 1 Dec 2018 16:51:54 +0800 Subject: [PATCH] update --- modeling/backbone/xception.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modeling/backbone/xception.py b/modeling/backbone/xception.py index b1b71280..47523674 100644 --- a/modeling/backbone/xception.py +++ b/modeling/backbone/xception.py @@ -86,7 +86,7 @@ def forward(self, inp): else: skip = inp - x += skip + x = x + skip return x @@ -120,7 +120,7 @@ def __init__(self, output_stride, BatchNorm, self.bn2 = BatchNorm(64) self.block1 = Block(64, 128, reps=2, stride=2, BatchNorm=BatchNorm, start_with_relu=False) - self.block2 = Block(128, 256, reps=2, stride=2, BatchNorm=BatchNorm, start_with_relu=True, + self.block2 = Block(128, 256, reps=2, stride=2, BatchNorm=BatchNorm, start_with_relu=False, grow_first=True) self.block3 = Block(256, 728, reps=2, stride=entry_block3_stride, BatchNorm=BatchNorm, start_with_relu=True, grow_first=True, is_last=True) @@ -190,6 +190,8 @@ def forward(self, x): x = self.relu(x) x = self.block1(x) + # add relu here + x = self.relu(x) low_level_feat = x x = self.block2(x) x = self.block3(x) @@ -241,6 +243,7 @@ def _init_weight(self): m.weight.data.fill_(1) m.bias.data.zero_() + def _load_pretrained_model(self): pretrain_dict = model_zoo.load_url('http://data.lip6.fr/cadene/pretrainedmodels/xception-b5690688.pth') model_dict = {}