Skip to content

Commit 452caa0

Browse files
Update plotlog.py
1 parent cd9374f commit 452caa0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

benchmark/paddle/image/plotlog.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ def plot_metric(metric,
7979
plt.figure()
8080
plt.title(graph_title)
8181
if line_num == 1:
82-
plt.plot(batch_id, metric, line_style, line_label)
82+
plt.plot(batch_id, metric, line_style, label=line_label)
8383
else:
8484
for i in range(line_num):
85-
plt.plot(batch_id, metric[i], line_style[i], line_label[i])
85+
plt.plot(batch_id, metric[i], line_style[i], label=line_label[i])
8686
plt.xlabel('batch')
8787
plt.ylabel(graph_title)
8888
plt.legend()
@@ -102,12 +102,12 @@ def main():
102102
accuracy_sample = sample(accuracy, args.sample_rate)
103103

104104
plot_metric(loss_sample, batch_sample, 'loss', line_label='loss')
105-
plot_metric(accuracy_sample,
106-
batch_sample,
107-
'accuracy',
108-
line_style='g-',
109-
line_label='accuracy')
110-
105+
plot_metric(
106+
accuracy_sample,
107+
batch_sample,
108+
'accuracy',
109+
line_style='g-',
110+
line_label='accuracy')
111111

112112
if __name__ == '__main__':
113113
main()

0 commit comments

Comments
 (0)