summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidbrai <davidbrai@gmail.com>2016-11-14 22:10:27 +0200
committerdavidbrai <davidbrai@gmail.com>2016-11-14 22:14:14 +0200
commitaaf7b6b17fdded6f6489eaf84a4d336b3344c356 (patch)
tree23c93e52e9f22ffc868ef2ad9a2bb4e8cc706609
parenteb4ba30e3c4899edc7a9713158d61503fa8ecf90 (diff)
downloadcaffeonacl-aaf7b6b17fdded6f6489eaf84a4d336b3344c356.tar.gz
caffeonacl-aaf7b6b17fdded6f6489eaf84a4d336b3344c356.tar.bz2
caffeonacl-aaf7b6b17fdded6f6489eaf84a4d336b3344c356.zip
support solver resumes in parse_log.py
Currently parse_log.py skips all non timestamped lines only once. When resuming a solver and appending to the same log file, it creates more non timestamped log lines. This change allows the script to silently skip those lines.
-rwxr-xr-xtools/extra/parse_log.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/extra/parse_log.py b/tools/extra/parse_log.py
index 375b0db7..017306b5 100755
--- a/tools/extra/parse_log.py
+++ b/tools/extra/parse_log.py
@@ -48,8 +48,13 @@ def parse_log(path_to_log):
# iteration
continue
- time = extract_seconds.extract_datetime_from_line(line,
- logfile_year)
+ try:
+ time = extract_seconds.extract_datetime_from_line(line,
+ logfile_year)
+ except ValueError:
+ # Skip lines with bad formatting, for example when resuming solver
+ continue
+
seconds = (time - start_time).total_seconds()
learning_rate_match = regex_learning_rate.search(line)