未验证 提交 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')
_logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO)
DOWNLOAD_RETRY_LIMIT=3
DOWNLOAD_RETRY_LIMIT = 3
def print_arguments(args):
"""Print argparse's arguments.
......@@ -92,7 +93,7 @@ def save_persistable_nodes(executor, dirname, graph):
persistable_nodes = []
all_persistable_nodes = graph.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:
persistable_node_names.add(name)
persistable_nodes.append(node)
......@@ -211,6 +212,7 @@ def _download(url, path, md5sum=None):
return fullname
def _md5check(fullname, md5sum=None):
if md5sum is None:
return True
......@@ -224,10 +226,11 @@ def _md5check(fullname, md5sum=None):
if calc_md5sum != md5sum:
_logger.info("File {} md5 check failed, {}(calc) != "
"{}(base)".format(fullname, calc_md5sum, md5sum))
"{}(base)".format(fullname, calc_md5sum, md5sum))
return False
return True
def _decompress(fname):
"""
Decompress for zip and tar file
......@@ -261,6 +264,7 @@ def _decompress(fname):
shutil.rmtree(fpath_tmp)
os.remove(fname)
def _move_and_merge_tree(src, dst):
"""
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.
先完成此消息的编辑!
想要评论请 注册