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. 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(' ');