From caf275193f44a54de29ebd18196f1fae7b4a9bf1 Mon Sep 17 00:00:00 2001 From: zhaoyingli <86812880+zhaoyinglia@users.noreply.github.com> Date: Mon, 24 Oct 2022 11:50:10 +0800 Subject: [PATCH] fix import in python3.6 (#47275) --- python/paddle/hapi/model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/hapi/model.py b/python/paddle/hapi/model.py index 56bbde53e5c..3534614cce5 100644 --- a/python/paddle/hapi/model.py +++ b/python/paddle/hapi/model.py @@ -47,10 +47,10 @@ from paddle.io import Dataset from paddle.io import DistributedBatchSampler from paddle.metric import Metric from paddle.static import InputSpec as Input -import paddle.distributed as dist -import paddle.distributed.fleet as fleet from paddle.distributed.fleet.base import role_maker from paddle.autograd import no_grad +from paddle.distributed import fleet +from paddle.distributed.parallel import init_parallel_env from .callbacks import config_callbacks, EarlyStopping from .model_summary import summary @@ -684,7 +684,7 @@ class DynamicGraphAdapter(object): self._use_fp16_guard = True if self._nranks > 1: - dist.init_parallel_env() + init_parallel_env() stradegy = fluid.dygraph.parallel.ParallelStrategy() stradegy.nranks = ParallelEnv().nranks stradegy.local_rank = ParallelEnv().local_rank -- GitLab