tensorboard icon indicating copy to clipboard operation
tensorboard copied to clipboard

Added fixes to problems that occur on python3

Open botev opened this issue 8 years ago • 2 comments

The following errors happened when initially running tensorboard in python3:

  1. The StringIO was 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.

  1. 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.

  1. 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 uint8 between 0 and 255.

botev avatar Jun 01 '17 23:06 botev

I just ran into this issue as well. It'd be great to have it merged.

keunhong avatar Jun 22 '17 11:06 keunhong

@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.

zihaolucky avatar Jun 23 '17 02:06 zihaolucky