Skip to content

Commit

Permalink
fix when killing before eval
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuziyi616 committed Jun 10, 2021
1 parent 63bdad9 commit 2b54eb7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/analysis_tools/analyze_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ def plot_curve(log_dicts, args):
ys = []
for epoch in epochs[args.interval - 1::args.interval]:
ys += log_dict[epoch][metric]

# if training is aborted before eval of the last epoch
# xs and ys will have different length and cause an error
# check if ys[-1] is empty here
if not log_dict[epoch][metric]:
xs = xs[:-1]

ax = plt.gca()
ax.set_xticks(xs)
plt.xlabel('epoch')
Expand Down

0 comments on commit 2b54eb7

Please sign in to comment.