Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleNotFoundError: No module named 'tensorflow.tensorboard.tensorboard'

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!

like image 667
Andriy Lazorenko Avatar asked Jun 21 '17 14:06

Andriy Lazorenko


2 Answers

An easy fix:

python -m tensorboard.main --logdir=/path/to/logs
like image 101
Adam Liu Avatar answered Sep 21 '22 13:09

Adam Liu


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

like image 33
Martin Avatar answered Sep 23 '22 13:09

Martin