aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGaofeng Cheng2017-10-09 22:24:49 -0500
committerDaniel Povey2017-10-09 22:24:49 -0500
commit98757696efce1ead21eca603e9f9d90d460d42f6 (patch)
treed4941ea5f8add83a6a5a8817346135e3fcc23130
parent9eccdbebc5204cf64c9995839a5b1b716e0b3973 (diff)
downloadkaldi-98757696efce1ead21eca603e9f9d90d460d42f6.tar.gz
kaldi-98757696efce1ead21eca603e9f9d90d460d42f6.tar.xz
kaldi-98757696efce1ead21eca603e9f9d90d460d42f6.zip
[scripts] Minor fix to nnet3 training scripts RE log parsing/time-reporting (#1926)HEADmaster
-rwxr-xr-xegs/wsj/s5/steps/libs/nnet3/report/log_parse.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/egs/wsj/s5/steps/libs/nnet3/report/log_parse.py b/egs/wsj/s5/steps/libs/nnet3/report/log_parse.py
index d21578bae..1341ae2e9 100755
--- a/egs/wsj/s5/steps/libs/nnet3/report/log_parse.py
+++ b/egs/wsj/s5/steps/libs/nnet3/report/log_parse.py
@@ -309,10 +309,11 @@ def parse_progress_logs_for_param_diff(exp_dir, pattern):
309 'max_iter': max_iter} 309 'max_iter': max_iter}
310 310
311 311
312def parse_train_logs(exp_dir): 312def get_train_times(exp_dir):
313 train_log_files = "%s/log/train.*.log" % (exp_dir) 313 train_log_files = "%s/log/" % (exp_dir)
314 train_log_names = "train.*.log"
314 train_log_lines = common_lib.get_command_stdout( 315 train_log_lines = common_lib.get_command_stdout(
315 'grep -e Accounting {0}'.format(train_log_files)) 316 'find {0} -name "{1}" | xargs grep -H -e Accounting'.format(train_log_files,train_log_names))
316 parse_regex = re.compile(".*train\.([0-9]+)\.([0-9]+)\.log:# " 317 parse_regex = re.compile(".*train\.([0-9]+)\.([0-9]+)\.log:# "
317 "Accounting: time=([0-9]+) thread.*") 318 "Accounting: time=([0-9]+) thread.*")
318 319
@@ -394,7 +395,7 @@ def parse_prob_logs(exp_dir, key='accuracy', output="output"):
394 395
395def generate_acc_logprob_report(exp_dir, key="accuracy", output="output"): 396def generate_acc_logprob_report(exp_dir, key="accuracy", output="output"):
396 try: 397 try:
397 times = parse_train_logs(exp_dir) 398 times = get_train_times(exp_dir)
398 except: 399 except:
399 tb = traceback.format_exc() 400 tb = traceback.format_exc()
400 logger.warning("Error getting info from logs, exception was: " + tb) 401 logger.warning("Error getting info from logs, exception was: " + tb)