From 95f18cb4d93e94b329cdb8a0aa7332018bd66402 Mon Sep 17 00:00:00 2001 From: tianhaodongbd <137985359+tianhaodongbd@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:10:43 +0800 Subject: [PATCH] fix out_path bug (#30) --- paddleapex/apex/run_paddle.py | 2 +- paddleapex/apex/run_torch.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddleapex/apex/run_paddle.py b/paddleapex/apex/run_paddle.py index 0b5f9d1..e9b1652 100644 --- a/paddleapex/apex/run_paddle.py +++ b/paddleapex/apex/run_paddle.py @@ -552,7 +552,7 @@ def arg_parser(parser): forward_content = api_json_read(cfg.json_path) out_path = os.path.realpath(cfg.out_path) if cfg.out_path else "./" if os.path.exists(out_path): - shutil.rmtree(out_path) + print_warn_log("The output path already exists and the file with the same name will be overwritten.") ut_case_parsing(forward_content, cfg) print_info_log("UT save completed") warning_log_pth = os.path.join(out_path, "./warning_log.txt") diff --git a/paddleapex/apex/run_torch.py b/paddleapex/apex/run_torch.py index b6a1d2a..e172c5e 100644 --- a/paddleapex/apex/run_torch.py +++ b/paddleapex/apex/run_torch.py @@ -596,7 +596,7 @@ def arg_parser(parser): "-out", "--dump_path", dest="out_path", - default="./paddle/", + default="./torch/", type=str, help=" The ut task result out path.", required=False, @@ -645,7 +645,7 @@ def arg_parser(parser): forward_content = api_json_read(cfg.json_path) out_path = os.path.realpath(cfg.out_path) if cfg.out_path else "./" if os.path.exists(out_path): - shutil.rmtree(out_path) + print_warn_log("The output path already exists and the file with the same name will be overwritten.") ut_case_parsing(forward_content, cfg) print_info_log("UT save completed") warning_log_pth = os.path.join(out_path, "./warning_log.txt")