From 8c491cf1bed61c339b198146de6196cf4f8686ab Mon Sep 17 00:00:00 2001 From: xmyqsh Date: Sat, 29 Apr 2017 21:35:33 +0800 Subject: [PATCH] fix roi-pooling and pool5 in Resnet50 --- lib/networks/Resnet50_test.py | 7 ++++--- lib/networks/Resnet50_train.py | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/networks/Resnet50_test.py b/lib/networks/Resnet50_test.py index 19fb727..b53ad27 100644 --- a/lib/networks/Resnet50_test.py +++ b/lib/networks/Resnet50_test.py @@ -209,7 +209,7 @@ def setup(self): #========= RCNN ============ (self.feed('res4f_relu','rois') - .roi_pool(7,7,1.0/16,name='res5a_branch2a_roipooling') + .roi_pool(14,14,1.0/16,name='res5a_branch2a_roipooling') .conv(1, 1, 512, 2, 2, biased=False, relu=False, name='res5a_branch2a', padding='VALID') .batch_normalization(relu=True, name='bn5a_branch2a',is_training=False) .conv(3, 3, 512, 1, 1, biased=False, relu=False, name='res5a_branch2b') @@ -247,9 +247,10 @@ def setup(self): 'bn5c_branch2c') .add(name='res5c') .relu(name='res5c_relu') + .avg_pool(7, 7, 1, 1, padding='VALID', name='pool5') .fc(n_classes, relu=False, name='cls_score') .softmax(name='cls_prob')) - (self.feed('res5c_relu') - .fc(n_classes*4, relu=False, name='bbox_pred')) \ No newline at end of file + (self.feed('pool5') + .fc(n_classes*4, relu=False, name='bbox_pred')) diff --git a/lib/networks/Resnet50_train.py b/lib/networks/Resnet50_train.py index bdf58a7..708b63c 100644 --- a/lib/networks/Resnet50_train.py +++ b/lib/networks/Resnet50_train.py @@ -220,7 +220,7 @@ def setup(self): #========= RCNN ============ (self.feed('res4f_relu','roi-data') - .roi_pool(7,7,1.0/16,name='res5a_branch2a_roipooling') + .roi_pool(14,14,1.0/16,name='res5a_branch2a_roipooling') .conv(1, 1, 512, 2, 2, biased=False, relu=False, name='res5a_branch2a', padding='VALID') .batch_normalization(relu=True, name='bn5a_branch2a',is_training=False) .conv(3, 3, 512, 1, 1, biased=False, relu=False, name='res5a_branch2b') @@ -257,8 +257,9 @@ def setup(self): 'bn5c_branch2c') .add(name='res5c') .relu(name='res5c_relu') + .avg_pool(7, 7, 1, 1, padding='VALID', name='pool5') .fc(n_classes, relu=False, name='cls_score') .softmax(name='cls_prob')) - (self.feed('res5c_relu') + (self.feed('pool5') .fc(n_classes*4, relu=False, name='bbox_pred'))