From d652a1bd7c325cb4783621f148adb6645067b706 Mon Sep 17 00:00:00 2001 From: michaelowenliu Date: Sun, 27 Sep 2020 10:45:32 +0800 Subject: [PATCH] fix a type in aspp --- dygraph/paddleseg/models/common/pyramid_pool.py | 6 ++++-- dygraph/paddleseg/models/deeplab.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dygraph/paddleseg/models/common/pyramid_pool.py b/dygraph/paddleseg/models/common/pyramid_pool.py index f196be50..d1c64338 100644 --- a/dygraph/paddleseg/models/common/pyramid_pool.py +++ b/dygraph/paddleseg/models/common/pyramid_pool.py @@ -79,13 +79,15 @@ class ASPPModule(nn.Layer): outputs = [] for block in self.aspp_blocks: - outputs.append(block(x)) + y = block(x) + y = F.resize_bilinear(y, out_shape=x.shape[2:]) + outputs.append(y) if self.image_pooling: img_avg = self.global_avg_pool(x) img_avg = F.resize_bilinear(img_avg, out_shape=x.shape[2:]) outputs.append(img_avg) - + x = paddle.concat(outputs, axis=1) x = self.conv_bn_relu(x) x = self.dropout(x) diff --git a/dygraph/paddleseg/models/deeplab.py b/dygraph/paddleseg/models/deeplab.py index 465503ee..56c23b5c 100644 --- a/dygraph/paddleseg/models/deeplab.py +++ b/dygraph/paddleseg/models/deeplab.py @@ -197,7 +197,7 @@ class DeepLabV3Head(nn.Layer): image_pooling=True) self.cls = nn.Conv2d( - in_channels=backbone_channels[0], + in_channels=aspp_out_channels, out_channels=num_classes, kernel_size=1) @@ -209,6 +209,7 @@ class DeepLabV3Head(nn.Layer): logit_list = [] x = feat_list[self.backbone_indices[0]] + x = self.aspp(x) logit = self.cls(x) logit_list.append(logit) -- GitLab