17

There seems to be a problem with recent TensorFlow build. The TensorBoard visualization tool would not run when it is compiled from sources to use with GPU. The error is as follows:

$ tensorboard Traceback (most recent call last): File "/home/gpu/anaconda3/envs/tensorflow/bin/tensorboard", line 7, in <module> from tensorflow.tensorboard.tensorboard import main ModuleNotFoundError: No module named 'tensorflow.tensorboard.tensorboard' 

Specs of system: Ubuntu 16.04, NVIDIA GTX 1070, cuda-8.0, cudnn 6.0. Installed using Bazel from sources as described here: https://www.tensorflow.org/install/install_sources

Installed into fresh anaconda3 environment 'tensorflow', environment is activated when performing command.

Would appreciate any help!

5 Answers 5

28

An easy fix:

python -m tensorboard.main --logdir=/path/to/logs 
Sign up to request clarification or add additional context in comments.

Comments

4

After some trial and error, I have solved this issue by adapting the file tensorboard-script.py in path/to/conda/envs/myenv/Scripts (Windows) as follows:

if __name__ == '__main__': import sys #import tensorflow.tensorboard.tensorboard import tensorboard.main #sys.exit(tensorflow.tensorboard.tensorboard.main()) sys.exit(tensorboard.main.main()) 

Now I can invoke tensorboard as expected: tensorboard --logdir=log/ --port 6006

Comments

2

Okay, I've found a solution that works and also received some explanation from tensorflower on github.

There might be an issue with tensorboard when compiling tensorflow from sources because tensorboard is now removed to a separate repo and is not a part of tensorflow. The tensorflower said the docs will be updated eventually, but I figured a workaround for the impatient (like myself).

Edit tensorboard file inside tensorflow/bin (/home/gpu/anaconda3/envs/tensorflow/bin/tensorboard in my case) and replace

from tensorflow.tensorboard.tensorboard import main

by

from tensorflow.tensorboard.main import *

Now tensorboard should run from console as usual.

3 Comments

Still getting the error: ModuleNotFoundError: No module named 'tensorflow.tensorboard' :(
python -m tensorboard.main --logdir=/path/to/logs is helpful
And the link to github discussion: github.com/tensorflow/tensorflow/issues/10959
1

Tensorboard ships with tensorflow. If you are unable to run using tensorboard command, try below approach. tensorboard.py might have been moved to different directory.

Try searching for tensorboard.py in the tensorbard directory where tensorflow is installed. Go to the path and use following line for visualization:

python tensorboard.py --logdir=path 

1 Comment

The tensorboard.py file cannot be found anywhere. tensorboard folder inside tensorflow folder only contains main.py. However, when the following command python main.py --logdir=path is executed inside the tensorboard folder, tensorboard starts. It's great that I'm finally able to start it but I wonder, what caused tensorboard command to fail in the first place...
-1

You should priorly launch pip install tensorflow.tensorboard

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.