From aab602c4e7eebe11edd22c252291f63e41d48511 Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Thu, 9 Aug 2018 05:55:57 +0000 Subject: [PATCH] Add ce for ocr model. --- fluid/ocr_recognition/.run.sh | 1 + fluid/ocr_recognition/.run_ce.sh | 1 + fluid/ocr_recognition/ctc_train.py | 4 ++++ 3 files changed, 6 insertions(+) create mode 100644 fluid/ocr_recognition/.run.sh create mode 100644 fluid/ocr_recognition/.run_ce.sh diff --git a/fluid/ocr_recognition/.run.sh b/fluid/ocr_recognition/.run.sh new file mode 100644 index 00000000..8bb5b9cc --- /dev/null +++ b/fluid/ocr_recognition/.run.sh @@ -0,0 +1 @@ +python ctc_train.py --batch_size=128 --total_step=10000 --use_gpu=True diff --git a/fluid/ocr_recognition/.run_ce.sh b/fluid/ocr_recognition/.run_ce.sh new file mode 100644 index 00000000..17d36384 --- /dev/null +++ b/fluid/ocr_recognition/.run_ce.sh @@ -0,0 +1 @@ +python ctc_train.py --batch_size=128 --total_step=10000 --use_gpu=True | python _ce.py diff --git a/fluid/ocr_recognition/ctc_train.py b/fluid/ocr_recognition/ctc_train.py index dde07e51..dc68cc2e 100644 --- a/fluid/ocr_recognition/ctc_train.py +++ b/fluid/ocr_recognition/ctc_train.py @@ -98,6 +98,10 @@ def train(args, data_reader=ctc_reader): print "\nTime: %s; Iter[%d]; Test seq error: %s.\n" % ( time.time(), iter_num, str(test_seq_error[0])) + #Note: The following logs are special for CE monitoring. + #Other situations do not need to care about these logs. + print("kpis test_seq_error %f" % test_seq_error[0]) + def save_model(args, exe, iter_num): filename = "model_%05d" % iter_num fluid.io.save_params( -- GitLab