diff --git a/dygraph/benchmark/deeplabv3p.yml b/dygraph/benchmark/deeplabv3p.yml index a299bee30dbea80768d766e3473c6a7f6eb48254..bf9db712eb0015b009869ed76acaac6185fa879f 100644 --- a/dygraph/benchmark/deeplabv3p.yml +++ b/dygraph/benchmark/deeplabv3p.yml @@ -28,6 +28,7 @@ model: backbone: type: ResNet50_vd output_stride: 8 + multi_grid: [1, 2, 4] num_classes: 19 backbone_indices: [0, 3] aspp_ratios: [1, 12, 24, 36] diff --git a/dygraph/paddleseg/core/val.py b/dygraph/paddleseg/core/val.py index 936b257664380dbc0fbb8867a589b8461fd61335..ebc6e6695374a577a41f60524e0e85fa3a05bf0d 100644 --- a/dygraph/paddleseg/core/val.py +++ b/dygraph/paddleseg/core/val.py @@ -19,7 +19,7 @@ import tqdm import cv2 import paddle import paddle.nn.functional as F -from paddle import to_variable +from paddle import to_tensor import paddleseg.utils.logger as logger from paddleseg.utils import ConfusionMatrix @@ -47,7 +47,7 @@ def evaluate(model, timer.start() for iter, (im, im_info, label) in tqdm.tqdm( enumerate(eval_dataset), total=total_iters): - im = to_variable(im) + im = to_tensor(im) logits = model(im) pred = paddle.argmax(logits[0], axis=1) pred = pred.numpy().astype('float32') diff --git a/dygraph/paddleseg/cvlibs/callbacks.py b/dygraph/paddleseg/cvlibs/callbacks.py index e948344ae499f333e435fa41fbd8f458cb8b3e2e..13b6c1a1cb33c04b3689b01a6118b59e10d0f353 100644 --- a/dygraph/paddleseg/cvlibs/callbacks.py +++ b/dygraph/paddleseg/cvlibs/callbacks.py @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dygraph/paddleseg/cvlibs/manager.py b/dygraph/paddleseg/cvlibs/manager.py index 339070069c7e39532ec7fe2c826851a8d0f53df6..e6aace64213cebc275cbe831c5dfd6f6d372aa34 100644 --- a/dygraph/paddleseg/cvlibs/manager.py +++ b/dygraph/paddleseg/cvlibs/manager.py @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dygraph/paddleseg/env.py b/dygraph/paddleseg/env.py index 3bb0930a9cd50d8d2449909a506427420c614f2d..43f881508f9fa02b2c7a9a7aacda469ebee3303b 100644 --- a/dygraph/paddleseg/env.py +++ b/dygraph/paddleseg/env.py @@ -1,4 +1,3 @@ -# coding:utf-8 # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License" diff --git a/dygraph/paddleseg/models/common/__init__.py b/dygraph/paddleseg/models/common/__init__.py index 33b2611df67fbfe22604512c1f0d03c9012cb3b4..3024f08b4debee4f2ff459eae1e9680b62db63e9 100644 --- a/dygraph/paddleseg/models/common/__init__.py +++ b/dygraph/paddleseg/models/common/__init__.py @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,4 +14,4 @@ from . import layer_libs from . import activation -from . import pyramid_pool \ No newline at end of file +from . import pyramid_pool diff --git a/dygraph/paddleseg/models/common/activation.py b/dygraph/paddleseg/models/common/activation.py index 69af72e0ea96cd389e48511ff7f7d4bee8680a8a..f565fb07aa2901f5c6f39e65532bdee81af1ffd9 100644 --- a/dygraph/paddleseg/models/common/activation.py +++ b/dygraph/paddleseg/models/common/activation.py @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,8 +27,8 @@ class Activation(nn.Layer): >>> print(sigmoid) >>> not_exit_one = Activation("not_exit_one") - KeyError: "not_exit_one does not exist in the current dict_keys(['elu', 'gelu', 'hardshrink', - 'tanh', 'hardtanh', 'prelu', 'relu', 'relu6', 'selu', 'leakyrelu', 'sigmoid', 'softmax', + KeyError: "not_exit_one does not exist in the current dict_keys(['elu', 'gelu', 'hardshrink', + 'tanh', 'hardtanh', 'prelu', 'relu', 'relu6', 'selu', 'leakyrelu', 'sigmoid', 'softmax', 'softplus', 'softshrink', 'softsign', 'tanhshrink', 'logsigmoid', 'logsoftmax', 'hsigmoid'])" Args: @@ -57,4 +56,4 @@ class Activation(nn.Layer): if self._act is not None: return self.act_func(x) else: - return x \ No newline at end of file + return x diff --git a/dygraph/paddleseg/models/common/layer_libs.py b/dygraph/paddleseg/models/common/layer_libs.py index 0335cfacfd190f1d84a52e73feb05a316d7af4a2..d032a59cd031d23890f76bb30920d0541a8bc301 100644 --- a/dygraph/paddleseg/models/common/layer_libs.py +++ b/dygraph/paddleseg/models/common/layer_libs.py @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dygraph/paddleseg/models/common/pyramid_pool.py b/dygraph/paddleseg/models/common/pyramid_pool.py index d1c643382d8f4e2a02f3f158a2eea09d57c4adaf..07f73d5c96119115cba7ed8ea1b3a391a3d5f1dc 100644 --- a/dygraph/paddleseg/models/common/pyramid_pool.py +++ b/dygraph/paddleseg/models/common/pyramid_pool.py @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -87,7 +86,7 @@ class ASPPModule(nn.Layer): 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)