diff options
-rwxr-xr-x | egs/wsj/s5/steps/libs/nnet3/report/log_parse.py | 9 |
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 | ||
312 | def parse_train_logs(exp_dir): | 312 | def 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 | ||
395 | def generate_acc_logprob_report(exp_dir, key="accuracy", output="output"): | 396 | def 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) |