From 10b879118d4b83004a361339d5d22c0feaeae58f Mon Sep 17 00:00:00 2001 From: whs Date: Tue, 1 Nov 2022 16:06:54 +0800 Subject: [PATCH] Remove dependency on compat of PaddlePaddle (#1486) --- demo/utility.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/demo/utility.py b/demo/utility.py index 475468f2..dca4e953 100644 --- a/demo/utility.py +++ b/demo/utility.py @@ -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, -- GitLab