From f3bb9dd0f9635e6d772f0dbb32d7728849418192 Mon Sep 17 00:00:00 2001 From: Eren Golge Date: Fri, 27 Apr 2018 04:48:21 -0700 Subject: [PATCH] add model name to config --- config.json | 1 + train.py | 2 +- utils/generic_utils.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index 3eb74365..7ee1dd27 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,5 @@ { + "model_name": "guided-attn", "num_mels": 80, "num_freq": 1025, "sample_rate": 22050, diff --git a/train.py b/train.py index a0c614ab..71dd4dca 100644 --- a/train.py +++ b/train.py @@ -41,7 +41,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 83e958b3..609abf5c 100644 --- a/utils/generic_utils.py +++ b/utils/generic_utils.py @@ -35,11 +35,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