dmlc / tensorboard

Standalone TensorBoard for visualizing in deep learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StringIO issue when using python2

hanzhanggit opened this issue · comments

In the summary.py

"from six import StringIO" is not working for python 2.7.
So I got this error,
File "/home/hz138/anaconda2/lib/python2.7/site-packages/tensorboard/summary.py", line 186, in make_image
output = StringIO.StringIO()
AttributeError: class StringIO has no attribute 'StringIO'

Could you try change the output = StringIO.StringIO() to output = StringIO()?

@hanzhanggit Do you install from source or via PyPI?

I install from using the following command:
pip install tensorboard.
I have changed the source to be import StringIO instead of from six import StringIO to solve it locally(it might just work for python 2.7). But I think it is better to report this issue to fix it in the master branch.

Agree. six is for both Python2 and Python3 compatible.

But if we want to keep using six for StringIO, then we should change
output = StringIO.StringIO() to output=StringIO().
It works on python2.7, but I did not check it for python3. Hope it works as well.

let me make a fix later today. thank you.