From de7457c9f58972e3f8a1307dfbd2a2338ea0af67 Mon Sep 17 00:00:00 2001 From: candanzg Date: Sun, 19 Apr 2020 11:46:47 +0800 Subject: [PATCH] fixed bug for makedirs in python Signed-off-by: candanzg --- mindspore/train/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/train/_utils.py b/mindspore/train/_utils.py index 85b7629002..7bc07b126e 100644 --- a/mindspore/train/_utils.py +++ b/mindspore/train/_utils.py @@ -87,7 +87,7 @@ def _make_directory(path: str): # All exceptions need to be caught because create directory maybe have some limit(permissions) logger.debug("The directory(%s) doesn't exist, will create it", path) try: - os.makedirs(path) + os.makedirs(path, exist_ok=True) real_path = path except PermissionError as e: logger.error("No write permission on the directory(%r), error = %r", path, e)