未验证 提交 10b87911 编写于 作者: W whs 提交者: GitHub

Remove dependency on compat of PaddlePaddle (#1486)

上级 4a05264a
...@@ -36,7 +36,8 @@ logging.basicConfig(format='%(asctime)s-%(levelname)s: %(message)s') ...@@ -36,7 +36,8 @@ logging.basicConfig(format='%(asctime)s-%(levelname)s: %(message)s')
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO) _logger.setLevel(logging.INFO)
DOWNLOAD_RETRY_LIMIT=3 DOWNLOAD_RETRY_LIMIT = 3
def print_arguments(args): def print_arguments(args):
"""Print argparse's arguments. """Print argparse's arguments.
...@@ -92,7 +93,7 @@ def save_persistable_nodes(executor, dirname, graph): ...@@ -92,7 +93,7 @@ def save_persistable_nodes(executor, dirname, graph):
persistable_nodes = [] persistable_nodes = []
all_persistable_nodes = graph.all_persistable_nodes() all_persistable_nodes = graph.all_persistable_nodes()
for node in all_persistable_nodes: for node in all_persistable_nodes:
name = cpt.to_text(node.name()) name = node.name()
if name not in persistable_node_names: if name not in persistable_node_names:
persistable_node_names.add(name) persistable_node_names.add(name)
persistable_nodes.append(node) persistable_nodes.append(node)
...@@ -211,6 +212,7 @@ def _download(url, path, md5sum=None): ...@@ -211,6 +212,7 @@ def _download(url, path, md5sum=None):
return fullname return fullname
def _md5check(fullname, md5sum=None): def _md5check(fullname, md5sum=None):
if md5sum is None: if md5sum is None:
return True return True
...@@ -228,6 +230,7 @@ def _md5check(fullname, md5sum=None): ...@@ -228,6 +230,7 @@ def _md5check(fullname, md5sum=None):
return False return False
return True return True
def _decompress(fname): def _decompress(fname):
""" """
Decompress for zip and tar file Decompress for zip and tar file
...@@ -261,6 +264,7 @@ def _decompress(fname): ...@@ -261,6 +264,7 @@ def _decompress(fname):
shutil.rmtree(fpath_tmp) shutil.rmtree(fpath_tmp)
os.remove(fname) os.remove(fname)
def _move_and_merge_tree(src, dst): def _move_and_merge_tree(src, dst):
""" """
Move src directory to dst, if dst is already exists, Move src directory to dst, if dst is already exists,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册