From f3116ad7e86b1483a29820eab3ea448bf5f5de3f Mon Sep 17 00:00:00 2001 From: Tobias Hornberger Date: Tue, 17 Jul 2018 14:42:07 +0200 Subject: [PATCH 1/2] add handling of different lengths of scalarTags --- exportTensorFlowLog.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/exportTensorFlowLog.py b/exportTensorFlowLog.py index 436f269..d53d431 100644 --- a/exportTensorFlowLog.py +++ b/exportTensorFlowLog.py @@ -172,8 +172,12 @@ def exitWithUsage(): data = [v.wall_time, v.step]; for s in scalarTags: scalarTag = ea.Scalars(s); - S = scalarTag[i]; - data.append(S.value); + if i < len(scalarTag): + S = scalarTag[i]; + data.append(S.value); + else: + print("ScalarTag {} is too short - writing NaN".format(s)) + data.append(math.nan) logWriter.writerow(data); print(' '); From 935c51bc9d1d4424c2c3df397dc732470d2c41dc Mon Sep 17 00:00:00 2001 From: Tobias Hornberger Date: Tue, 17 Jul 2018 14:44:02 +0200 Subject: [PATCH 2/2] make usage and input consistent --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14a9958..6a6df75 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Tested on TensorFlow version 0.11.0, 1.1.0 and 1.3.0 and Python 2.7 and 3.6. ## Usage ``` -python readLogs.py +python readLogs.py Inputs: - Path to TensorFlow logfile.