From 45bb9d9eecb144a0039ec049eb7317226f14633e Mon Sep 17 00:00:00 2001 From: Eren Golge Date: Thu, 10 May 2018 16:14:23 -0700 Subject: [PATCH] Add model name to experiemtn folder --- train.py | 2 +- utils/generic_utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/train.py b/train.py index 996e7b4e..47586997 100644 --- a/train.py +++ b/train.py @@ -42,7 +42,7 @@ args = parser.parse_args() c = load_config(args.config_path) _ = os.path.dirname(os.path.realpath(__file__)) OUT_PATH = os.path.join(_, c.output_path) -OUT_PATH = create_experiment_folder(OUT_PATH) +OUT_PATH = create_experiment_folder(OUT_PATH, c.model_name) CHECKPOINT_PATH = os.path.join(OUT_PATH, 'checkpoints') shutil.copyfile(args.config_path, os.path.join(OUT_PATH, 'config.json')) diff --git a/utils/generic_utils.py b/utils/generic_utils.py index d42fcde4..b49b6d27 100644 --- a/utils/generic_utils.py +++ b/utils/generic_utils.py @@ -34,11 +34,11 @@ def get_commit_hash(): return commit -def create_experiment_folder(root_path): +def create_experiment_folder(root_path, model_name): """ Create a folder with the current date and time """ date_str = datetime.datetime.now().strftime("%B-%d-%Y_%I:%M%p") commit_hash = get_commit_hash() - output_folder = os.path.join(root_path, date_str + '-' + commit_hash) + output_folder = os.path.join(root_path, date_str + '-' + model_name + '-' + commit_hash) os.makedirs(output_folder, exist_ok=True) print(" > Experiment folder: {}".format(output_folder)) return output_folder