From 88d2afff16d10eaefe2f3d0e2c823c655f78dc42 Mon Sep 17 00:00:00 2001 From: curry3 <485078529@qq.com> Date: Tue, 10 Sep 2024 11:32:05 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90test=E3=80=91=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debug/accuracy_tools/msprobe/core/common/file_utils.py | 2 +- debug/accuracy_tools/msprobe/pytorch/hook_module/hook_module.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debug/accuracy_tools/msprobe/core/common/file_utils.py b/debug/accuracy_tools/msprobe/core/common/file_utils.py index 0976323b5..65163f3fa 100644 --- a/debug/accuracy_tools/msprobe/core/common/file_utils.py +++ b/debug/accuracy_tools/msprobe/core/common/file_utils.py @@ -241,7 +241,7 @@ def make_dir(dir_path): if os.path.isdir(dir_path): return try: - os.mkdir(dir_path, mode=FileCheckConst.DATA_DIR_AUTHORITY) + os.makedirs(dir_path, mode=FileCheckConst.DATA_DIR_AUTHORITY, exist_ok=True) except OSError as ex: raise FileCheckException(FileCheckException.ILLEGAL_PATH_ERROR, f"Failed to create {dir_path}. " diff --git a/debug/accuracy_tools/msprobe/pytorch/hook_module/hook_module.py b/debug/accuracy_tools/msprobe/pytorch/hook_module/hook_module.py index aa724b50f..c2feff0bd 100644 --- a/debug/accuracy_tools/msprobe/pytorch/hook_module/hook_module.py +++ b/debug/accuracy_tools/msprobe/pytorch/hook_module/hook_module.py @@ -56,7 +56,7 @@ class HOOKModule(nn.Module): else: self.register_forward_pre_hook(forward_pre_hook) self.register_forward_hook(forward_hook) - self.register_backward_hook(backward_hook) + self.register_full_backward_hook(backward_hook) def __call__(self, *input, **kwargs): changed = False -- Gitee