summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEvan Shelhamer <shelhamer@imaginarynumber.net>2017-02-16 16:28:53 -0800
committerGitHub <noreply@github.com>2017-02-16 16:28:53 -0800
commit8a7a61a142d14886ddf279459fc5239f66d48a62 (patch)
tree7a6894800bef16e85acec6ab42ba671496922b85 /tools
parentc5fad40d336883feb64cb0405abd4f56579faa83 (diff)
parentde3a12f46217dcac8aae467931e6d5ffb5fbc4e2 (diff)
downloadcaffeonacl-8a7a61a142d14886ddf279459fc5239f66d48a62.tar.gz
caffeonacl-8a7a61a142d14886ddf279459fc5239f66d48a62.tar.bz2
caffeonacl-8a7a61a142d14886ddf279459fc5239f66d48a62.zip
Merge pull request #5074 from garion9013/master
Fix plot_training_log.py.example
Diffstat (limited to 'tools')
-rwxr-xr-xtools/extra/plot_training_log.py.example17
1 files changed, 5 insertions, 12 deletions
diff --git a/tools/extra/plot_training_log.py.example b/tools/extra/plot_training_log.py.example
index 79924ae5..8caca6b8 100755
--- a/tools/extra/plot_training_log.py.example
+++ b/tools/extra/plot_training_log.py.example
@@ -90,9 +90,9 @@ def load_data(data_file, field_idx0, field_idx1):
def random_marker():
markers = mks.MarkerStyle.markers
- num = len(markers.values())
+ num = len(markers.keys())
idx = random.randint(0, num - 1)
- return markers.values()[idx]
+ return markers.keys()[idx]
def get_data_label(path_to_log):
label = path_to_log[path_to_log.rfind('/')+1 : path_to_log.rfind(
@@ -126,16 +126,9 @@ def plot_chart(chart_type, path_to_png, path_to_log_list):
plt.plot(data[0], data[1], label = label, color = color,
linewidth = linewidth)
else:
- ok = False
- ## Some markers throw ValueError: Unrecognized marker style
- while not ok:
- try:
- marker = random_marker()
- plt.plot(data[0], data[1], label = label, color = color,
- marker = marker, linewidth = linewidth)
- ok = True
- except:
- pass
+ marker = random_marker()
+ plt.plot(data[0], data[1], label = label, color = color,
+ marker = marker, linewidth = linewidth)
legend_loc = get_legend_loc(chart_type)
plt.legend(loc = legend_loc, ncol = 1) # ajust ncol to fit the space
plt.title(get_chart_type_description(chart_type))