From 5dcd2de19dce9ae4b5e751be319f4b6ed1aec0d9 Mon Sep 17 00:00:00 2001 From: michaelowenliu Date: Thu, 27 Aug 2020 09:26:21 +0800 Subject: [PATCH] change BN in bachbones to SyncBN --- dygraph/models/architectures/mobilenetv3.py | 3 ++- dygraph/models/architectures/resnet_vd.py | 3 ++- dygraph/models/architectures/xception_deeplab.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dygraph/models/architectures/mobilenetv3.py b/dygraph/models/architectures/mobilenetv3.py index 91aa0563..cc7043db 100644 --- a/dygraph/models/architectures/mobilenetv3.py +++ b/dygraph/models/architectures/mobilenetv3.py @@ -21,7 +21,8 @@ import paddle import paddle.fluid as fluid from paddle.fluid.param_attr import ParamAttr from paddle.fluid.layer_helper import LayerHelper -from paddle.fluid.dygraph.nn import Conv2D, Pool2D, BatchNorm, Linear, Dropout +from paddle.fluid.dygraph.nn import Conv2D, Pool2D, Linear, Dropout +from paddle.fluid.dygraph import SyncBatchNorm as BatchNorm import math diff --git a/dygraph/models/architectures/resnet_vd.py b/dygraph/models/architectures/resnet_vd.py index b08dcd90..2fcf8376 100644 --- a/dygraph/models/architectures/resnet_vd.py +++ b/dygraph/models/architectures/resnet_vd.py @@ -24,7 +24,8 @@ import paddle import paddle.fluid as fluid from paddle.fluid.param_attr import ParamAttr from paddle.fluid.layer_helper import LayerHelper -from paddle.fluid.dygraph.nn import Conv2D, Pool2D, BatchNorm, Linear, Dropout +from paddle.fluid.dygraph.nn import Conv2D, Pool2D, Linear, Dropout +from paddle.fluid.dygraph import SyncBatchNorm as BatchNorm from dygraph.utils import utils diff --git a/dygraph/models/architectures/xception_deeplab.py b/dygraph/models/architectures/xception_deeplab.py index 1cb0f2a9..f856ffde 100644 --- a/dygraph/models/architectures/xception_deeplab.py +++ b/dygraph/models/architectures/xception_deeplab.py @@ -2,7 +2,8 @@ import paddle import paddle.fluid as fluid from paddle.fluid.param_attr import ParamAttr from paddle.fluid.layer_helper import LayerHelper -from paddle.fluid.dygraph.nn import Conv2D, Pool2D, BatchNorm, Linear, Dropout +from paddle.fluid.dygraph.nn import Conv2D, Pool2D, Linear, Dropout +from paddle.fluid.dygraph import SyncBatchNorm as BatchNorm from dygraph.cvlibs import manager -- GitLab