From 8007a9552870bdcef8f0ada1547d9ce1af0532fb Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Wed, 13 May 2020 16:39:39 +0800 Subject: [PATCH] makedirs for ocr rec saved model --- tools/program.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/program.py b/tools/program.py index dc14086d..a35fe6c9 100755 --- a/tools/program.py +++ b/tools/program.py @@ -284,6 +284,10 @@ def train_eval_rec_run(config, exe, train_info_dict, eval_info_dict): eval_batch_step = config['Global']['eval_batch_step'] save_epoch_step = config['Global']['save_epoch_step'] save_model_dir = config['Global']['save_model_dir'] + if save_model_dir[-1] == "/": + save_model_dir = save_model_dir[:-1] + if not os.path.exists(save_model_dir + config['Global']['algorithm']): + os.makedirs(save_model_dir) train_stats = TrainingStats(log_smooth_window, ['loss', 'acc']) best_eval_acc = -1 best_batch_id = 0 -- GitLab