Added fixes to problems that occur on python3
The following errors happened when initially running tensorboard in python3:
- The
StringIOwas giving the following error:
TypeError: string argument expected, got 'bytes'
Applied the fix from here: https://stackoverflow.com/questions/6479100/python-stringio-replacement-that-works-with-bytes-instead-of-strings , which suggests that BytesIO will work on both python2 and python3.
- When trying to pass a gray-scale image (e.g. 2D array) when passing it to PIL I got:
https://stackoverflow.com/questions/16720682/pil-cannot-write-mode-f-to-jpeg
Thus I added a line to convert it to RGB. This made the colorspace redundant as it already converts it to 3 channel even in the case of 2 channels.
- Finally when saving images with float32 type between 0 and 1 tensorboard was displaying them as all black. For this I added a direct conversion to
uint8between 0 and 255.
I just ran into this issue as well. It'd be great to have it merged.
@keunhong Could you help verify this? Thank you.
I'm going to change the backend to tensorflow/tensorboard these days first, and change the project name to tensorboard-lite, as the TensorBoard dev team has released their version but still rely on TF. The interface of our project won't change.