Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow visualizer "Tensorboard" not working under Anaconda

I'm currently using tensorflow and I want to visualize the effect of the convolutional neural network that I'm writing. However, I can't use tensorboard. I see the tensorboard underneath my conda env as envs/tensorenv/bin/tensorboard (python file). It imports this thing called tensorflow.tensorboard.tensorboard that it can't find.

(tensorenv)wifi-131-179-39-186:TensorflowTutorial hongshuhong$ tensorboard --logdir=log/
Traceback (most recent call last):
  File "/Users/hongshuhong/anaconda/envs/tensorenv/bin/tensorboard", line 4, in <module>
    import tensorflow.tensorboard.tensorboard
ImportError: No module named 'tensorflow.tensorboard.tensorboard'
  • I tried looking for the tensorflow.tensorboard.tensorboard but I don't see it anywhere in my directories.
  • I'm using Mac OSX distro of tensorflow under anaconda, using python 3.5.1 and using anaconda's packages.
  • I'm using ipython notebook for the code for the convnet.

Any help would be appreciated. Let me know if extra information is needed, thanks.

like image 913
OneRaynyDay Avatar asked Apr 14 '16 06:04

OneRaynyDay


People also ask

What port does TensorBoard use?

where the -p 6006 is the default port of TensorBoard.


2 Answers

Work it like this command

python /Users/USERNAME/anaconda/envs/tf/lib/python3.5/site-packages/tensorboard/main.py --logdir=./logs/

tensorboard.py is changed to main.py

like image 89
KyungHoon Kim Avatar answered Oct 13 '22 18:10

KyungHoon Kim


Actually @Andras Deak helped me with this answer, but according to this github issue link: https://github.com/tensorflow/tensorflow/issues/1790 The anaconda version doesn't work because for some reason the tensorboard is inside of the "backend" directory. you have to navigate yourself to the correct directory and execute the python script, which is:

python ~/anaconda/envs/tensorenv/lib/python3.5/site-packages/tensorflow/tensorboard/backend/tensorboard.py

It worked for me: enter image description here

I'm currently working on a way for a permanent fix, but this is a temporary way to fix it.

EDIT: So actually for the permanent fix, all you need to do is copy tensorboard.py into the outer directory. For me, it was inside of

..../site-packages/tensorflow/tensorboard/backend/tensorboard.py 

into

..../site-packages/tensorflow/tensorboard/tensorboard.py. 

I kept the one in backend, and just copied it over and it seems to work for a scalar_summary display. Let me know if any errors come up guys!

like image 20
OneRaynyDay Avatar answered Oct 13 '22 20:10

OneRaynyDay