waleedka / hiddenlayer

Neural network graphs and training metrics for PyTorch, Tensorflow, and Keras.
MIT License
1.79k stars 266 forks source link

TypeError: 'Metric' object does not support indexing #15

Closed ybpaopao closed 5 years ago

ybpaopao commented 5 years ago

Hi, I installed hiddenlayer and then tried to run the demo "history_canvas.py". But there is something wrong. The error message is "Step 0: loss: 1.042669959384648 accuracy: 0.06743948517530154
Traceback (most recent call last): File "./demos/history_canvas.py", line 43, in c.draw_plot(h["loss"], h["accuracy"]) File "/home/yangbiao/hiddenlayer-master/hiddenlayer/canvas.py", line 153, in wrapper self.render() File "/home/yangbiao/hiddenlayer-master/hiddenlayer/canvas.py", line 133, in render getattr(self, method)(*c[1], **c[2]) File "/home/yangbiao/hiddenlayer-master/hiddenlayer/canvas.py", line 180, in draw_plot label = labels[i] if labels else m.name TypeError: 'Metric' object does not support indexing." I used python 3.5.2 and did not use jupter note. I'm not sure whether the mistake is caused by the python version? Please give me some advice about it. Thx.

waleedka commented 5 years ago

Looks like you caught a bug. I just pushed a fix. Thanks for reporting this.