From 21a276b670a28fd3b4eeac25efd3a1128c8f08b6 Mon Sep 17 00:00:00 2001 From: mapingshuo Date: Wed, 23 Sep 2020 14:16:19 +0800 Subject: [PATCH] Fix bugs in hdfs download --- python/paddle/distributed/fleet/__init__.py | 1 + python/paddle/distributed/fleet/base/fleet_base.py | 3 +++ python/paddle/distributed/fleet/utils/fs.py | 3 --- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/python/paddle/distributed/fleet/__init__.py b/python/paddle/distributed/fleet/__init__.py index f3ee09a6d9e..d99218ae448 100644 --- a/python/paddle/distributed/fleet/__init__.py +++ b/python/paddle/distributed/fleet/__init__.py @@ -29,6 +29,7 @@ __all__ = [ ] fleet = Fleet() +_role_maker_ = fleet._role_maker_ init = fleet.init is_first_worker = fleet.is_first_worker worker_index = fleet.worker_index diff --git a/python/paddle/distributed/fleet/base/fleet_base.py b/python/paddle/distributed/fleet/base/fleet_base.py index 0ee140941cc..ed94e785a2e 100644 --- a/python/paddle/distributed/fleet/base/fleet_base.py +++ b/python/paddle/distributed/fleet/base/fleet_base.py @@ -190,6 +190,9 @@ class Fleet(object): else: paddle.distributed.init_parallel_env() + def _role_maker_(self): + return self._role_maker + def is_first_worker(self): """ Check whether the node is the first instance of worker. diff --git a/python/paddle/distributed/fleet/utils/fs.py b/python/paddle/distributed/fleet/utils/fs.py index b7c50bda3ea..d821c190f62 100644 --- a/python/paddle/distributed/fleet/utils/fs.py +++ b/python/paddle/distributed/fleet/utils/fs.py @@ -751,9 +751,6 @@ class HDFSClient(FS): client = HDFSClient(hadoop_home, configs) client.download("hdfs:/test_hdfs_client", "./") """ - if self.is_exist(local_path): - raise FSFileExistsError("{} exists".format(local_path)) - if not self.is_exist(fs_path): raise FSFileNotExistsError("{} not exits".format(fs_path)) -- GitLab