From bfc390cc62358d07a226dd221fc7243acd63f022 Mon Sep 17 00:00:00 2001 From: Difers <707065510@qq.com> Date: Wed, 9 Aug 2023 16:34:31 +0800 Subject: [PATCH] fix type error --- python/paddle/static/nn/common.py | 4 ++-- test/collective/fleet/parallel_dygraph_se_resnext.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/static/nn/common.py b/python/paddle/static/nn/common.py index f04dc277e4e0d..41ec17f0567a6 100644 --- a/python/paddle/static/nn/common.py +++ b/python/paddle/static/nn/common.py @@ -24,7 +24,7 @@ check_type, check_variable_and_dtype, ) -from paddle.fluid import core, layers, unique_name +from paddle.fluid import core, unique_name from paddle.fluid.data_feeder import check_dtype from paddle.fluid.framework import ( Program, @@ -4210,7 +4210,7 @@ def update(self): Update Exponential Moving Average. Should only call this method in train program. """ - global_step = layers.autoincreased_step_counter( + global_step = paddle.optimizer.lr.autoincreased_step_counter( counter_name=self._step_counter_name ) param_master_emas = [] diff --git a/test/collective/fleet/parallel_dygraph_se_resnext.py b/test/collective/fleet/parallel_dygraph_se_resnext.py index 8e9568e8fa49c..c24e4e7ebef3d 100644 --- a/test/collective/fleet/parallel_dygraph_se_resnext.py +++ b/test/collective/fleet/parallel_dygraph_se_resnext.py @@ -66,7 +66,7 @@ def optimizer_setting(params, parameter_list=None): parameter_list=parameter_list, ) else: - optimizer = fluid.optimizer.Momentum( + optimizer = paddle.optimizer.Momentum( learning_rate=paddle.optimizer.lr.cosine_decay( learning_rate=lr, step_each_epoch=step, epochs=num_epochs ),