未验证 提交 caf27519 编写于 作者: Z zhaoyingli 提交者: GitHub

fix import in python3.6 (#47275)

上级 9780eb72
...@@ -47,10 +47,10 @@ from paddle.io import Dataset ...@@ -47,10 +47,10 @@ from paddle.io import Dataset
from paddle.io import DistributedBatchSampler from paddle.io import DistributedBatchSampler
from paddle.metric import Metric from paddle.metric import Metric
from paddle.static import InputSpec as Input 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.distributed.fleet.base import role_maker
from paddle.autograd import no_grad 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 .callbacks import config_callbacks, EarlyStopping
from .model_summary import summary from .model_summary import summary
...@@ -684,7 +684,7 @@ class DynamicGraphAdapter(object): ...@@ -684,7 +684,7 @@ class DynamicGraphAdapter(object):
self._use_fp16_guard = True self._use_fp16_guard = True
if self._nranks > 1: if self._nranks > 1:
dist.init_parallel_env() init_parallel_env()
stradegy = fluid.dygraph.parallel.ParallelStrategy() stradegy = fluid.dygraph.parallel.ParallelStrategy()
stradegy.nranks = ParallelEnv().nranks stradegy.nranks = ParallelEnv().nranks
stradegy.local_rank = ParallelEnv().local_rank stradegy.local_rank = ParallelEnv().local_rank
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册