From 3845229dc8d1b5279e3f7c28ed333a6a9ba157b5 Mon Sep 17 00:00:00 2001 From: wuhuachaocoding <77733235+wuhuachaocoding@users.noreply.github.com> Date: Wed, 21 Sep 2022 10:14:45 +0800 Subject: [PATCH] update for py3.6 bug (#46304) --- python/paddle/incubate/optimizer/distributed_fused_lamb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/incubate/optimizer/distributed_fused_lamb.py b/python/paddle/incubate/optimizer/distributed_fused_lamb.py index 60661700e13..3f3df92be5e 100644 --- a/python/paddle/incubate/optimizer/distributed_fused_lamb.py +++ b/python/paddle/incubate/optimizer/distributed_fused_lamb.py @@ -13,6 +13,7 @@ # limitations under the License. import os +import paddle from paddle.fluid import framework, core, layers, unique_name from paddle.fluid.framework import Variable from paddle.fluid.clip import ClipGradByGlobalNorm @@ -287,9 +288,8 @@ class DistributedFusedLamb(Optimizer): step = self._get_or_create_step() - from paddle.distributed import get_rank, get_world_size - rank = get_rank() - nranks = get_world_size() + rank = paddle.distributed.get_rank() + nranks = paddle.distributed.get_world_size() if self._nproc_per_node is None: nproc_per_node = nranks else: -- GitLab