From 9126cb6fb95cba31b1bd7b6a6c5e66bbc2458e5a Mon Sep 17 00:00:00 2001
From: LDOUBLEV <liuvv0203@outlook.com>
Date: Wed, 13 May 2020 16:51:36 +0800
Subject: [PATCH] modify rec saved model dir

---
 configs/rec/rec_mv3_none_bilstm_ctc.yml    | 2 +-
 configs/rec/rec_mv3_none_none_ctc.yml      | 2 +-
 configs/rec/rec_mv3_tps_bilstm_attn.yml    | 2 +-
 configs/rec/rec_mv3_tps_bilstm_ctc.yml     | 2 +-
 configs/rec/rec_r34_vd_none_bilstm_ctc.yml | 2 +-
 configs/rec/rec_r34_vd_none_none_ctc.yml   | 2 +-
 configs/rec/rec_r34_vd_tps_bilstm_attn.yml | 2 +-
 configs/rec/rec_r34_vd_tps_bilstm_ctc.yml  | 2 +-
 tools/program.py                           | 4 +---
 9 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/configs/rec/rec_mv3_none_bilstm_ctc.yml b/configs/rec/rec_mv3_none_bilstm_ctc.yml
index ea1046380..11a09ee92 100755
--- a/configs/rec/rec_mv3_none_bilstm_ctc.yml
+++ b/configs/rec/rec_mv3_none_bilstm_ctc.yml
@@ -4,7 +4,7 @@ Global:
   epoch_num: 72
   log_smooth_window: 20
   print_batch_step: 10
-  save_model_dir: output/rec
+  save_model_dir: output/rec_CRNN
   save_epoch_step: 3
   eval_batch_step: 2000
   train_batch_size_per_card: 256
diff --git a/configs/rec/rec_mv3_none_none_ctc.yml b/configs/rec/rec_mv3_none_none_ctc.yml
index 066227839..bbbb6d1fa 100755
--- a/configs/rec/rec_mv3_none_none_ctc.yml
+++ b/configs/rec/rec_mv3_none_none_ctc.yml
@@ -4,7 +4,7 @@ Global:
   epoch_num: 72
   log_smooth_window: 20
   print_batch_step: 10
-  save_model_dir: output/rec
+  save_model_dir: output/rec_Rosetta
   save_epoch_step: 3
   eval_batch_step: 2000
   train_batch_size_per_card: 256
diff --git a/configs/rec/rec_mv3_tps_bilstm_attn.yml b/configs/rec/rec_mv3_tps_bilstm_attn.yml
index f5ba60d95..03a2e901b 100755
--- a/configs/rec/rec_mv3_tps_bilstm_attn.yml
+++ b/configs/rec/rec_mv3_tps_bilstm_attn.yml
@@ -4,7 +4,7 @@ Global:
   epoch_num: 72
   log_smooth_window: 20
   print_batch_step: 10
-  save_model_dir: output/rec
+  save_model_dir: output/rec_RARE
   save_epoch_step: 3
   eval_batch_step: 2000
   train_batch_size_per_card: 256
diff --git a/configs/rec/rec_mv3_tps_bilstm_ctc.yml b/configs/rec/rec_mv3_tps_bilstm_ctc.yml
index 132320bc7..47247b723 100755
--- a/configs/rec/rec_mv3_tps_bilstm_ctc.yml
+++ b/configs/rec/rec_mv3_tps_bilstm_ctc.yml
@@ -4,7 +4,7 @@ Global:
   epoch_num: 72
   log_smooth_window: 20
   print_batch_step: 10
-  save_model_dir: output/rec
+  save_model_dir: output/rec_STARNet
   save_epoch_step: 3
   eval_batch_step: 2000
   train_batch_size_per_card: 256
diff --git a/configs/rec/rec_r34_vd_none_bilstm_ctc.yml b/configs/rec/rec_r34_vd_none_bilstm_ctc.yml
index b784c7f89..101819361 100755
--- a/configs/rec/rec_r34_vd_none_bilstm_ctc.yml
+++ b/configs/rec/rec_r34_vd_none_bilstm_ctc.yml
@@ -4,7 +4,7 @@ Global:
   epoch_num: 72
   log_smooth_window: 20
   print_batch_step: 10
-  save_model_dir: output/rec
+  save_model_dir: output/rec_CRNN
   save_epoch_step: 3
   eval_batch_step: 2000
   train_batch_size_per_card: 256
diff --git a/configs/rec/rec_r34_vd_none_none_ctc.yml b/configs/rec/rec_r34_vd_none_none_ctc.yml
index 9d42e6d15..ff4c57634 100755
--- a/configs/rec/rec_r34_vd_none_none_ctc.yml
+++ b/configs/rec/rec_r34_vd_none_none_ctc.yml
@@ -4,7 +4,7 @@ Global:
   epoch_num: 72
   log_smooth_window: 20
   print_batch_step: 10
-  save_model_dir: output/rec
+  save_model_dir: output/rec_Rosetta
   save_epoch_step: 3
   eval_batch_step: 2000
   train_batch_size_per_card: 256
diff --git a/configs/rec/rec_r34_vd_tps_bilstm_attn.yml b/configs/rec/rec_r34_vd_tps_bilstm_attn.yml
index a77e457b4..4d96e9e72 100755
--- a/configs/rec/rec_r34_vd_tps_bilstm_attn.yml
+++ b/configs/rec/rec_r34_vd_tps_bilstm_attn.yml
@@ -4,7 +4,7 @@ Global:
   epoch_num: 72
   log_smooth_window: 20
   print_batch_step: 10
-  save_model_dir: output/rec
+  save_model_dir: output/rec_RARE
   save_epoch_step: 3
   eval_batch_step: 2000
   train_batch_size_per_card: 256
diff --git a/configs/rec/rec_r34_vd_tps_bilstm_ctc.yml b/configs/rec/rec_r34_vd_tps_bilstm_ctc.yml
index 3768aa47c..844721a2e 100755
--- a/configs/rec/rec_r34_vd_tps_bilstm_ctc.yml
+++ b/configs/rec/rec_r34_vd_tps_bilstm_ctc.yml
@@ -4,7 +4,7 @@ Global:
   epoch_num: 72
   log_smooth_window: 20
   print_batch_step: 10
-  save_model_dir: output/rec
+  save_model_dir: output/rec_STARNet
   save_epoch_step: 3
   eval_batch_step: 2000
   train_batch_size_per_card: 256
diff --git a/tools/program.py b/tools/program.py
index a35fe6c95..6c9e9904c 100755
--- a/tools/program.py
+++ b/tools/program.py
@@ -284,9 +284,7 @@ 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']):
+    if not os.path.exists(save_model_dir):
         os.makedirs(save_model_dir)
     train_stats = TrainingStats(log_smooth_window, ['loss', 'acc'])
     best_eval_acc = -1