Tensorboard: pip installed tensorboard producing "importerror"

Created on 8 Jul 2017  路  12Comments  路  Source: tensorflow/tensorboard

when I run tensorboard --logdir=/home/wangxiaopeng/models-master/object_detection/data/train_dir/, it generate the erro:
Traceback (most recent call last):
File "/usr/local/bin/tensorboard", line 7, in
from tensorflow.tensorboard.tensorboard import main
ImportError: No module named tensorboard

Most helpful comment

@Surya97 Same issue. python -m tensorboard.main --logdir=/your/model/dir solved my problem.

All 12 comments

Let me get back to you on this in a few days, when we release a new TensorBoard via pip.

Actually:

Looking at this, I see you're getting from tensorflow.tensorboard, which is code that existed in the TensorFlow pip package, but not in the current one. It might be an upgrade pain from moving tensorboard out of the tensorflow pip package and into (for now) tensorflow-tensorboard.

Could you tell me how you got TensorBoard? Was it via pip install tensorflow or pip install tensorflow-tensorboard?

hello @dandelionmane , i via pip install tensorflow to get TensorBoard, and i try to use pip uninstall tensorboard is failed :" Cannot uninstall requirement tensorboard, not installed"

@dandelionmane i try to using pip install tensorboard-master(1).zip ,generate error below:
Unpacking ./tensorboard-master(1).zip
Running setup.py (path:/tmp/pip-RBbATz-build/setup.py) egg_info for package from file:///home/wangxiaopeng/tensorboard-master%281%29.zip
Traceback (most recent call last):
File "", line 17, in
IOError: [Errno 2] No such file or directory: '/tmp/pip-RBbATz-build/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 17, in

IOError: [Errno 2] No such file or directory: '/tmp/pip-RBbATz-build/setup.py'

@dandelionmane how to use pip installed tensorboard as a bin file like before? not via bazel

@wxp0329 Please note that the name of our pip package is tensorflow-tensorboard and not tensorboard. tensorboard is an unaffiliated project.

It also looks like you're trying to install our git repository directly as a wheel; that won't work. Please try using pip install --upgrade tensorflow tensorflow-tensorboard.

@argman The command that you're looking for is pip install --upgrade tensorflow tensorflow-tensorboard.

@wchargin after entering what you said, I get this:

Mon Nov 13 00:37:49 :~$  /Users/mona/anaconda/bin/pip  install --upgrade tensorflow tensorflow-tensorboard
Collecting tensorflow
  Downloading tensorflow-1.4.0-cp36-cp36m-macosx_10_11_x86_64.whl (39.3MB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 39.3MB 28kB/s
Collecting tensorflow-tensorboard
  Downloading tensorflow_tensorboard-0.1.8-py3-none-any.whl (1.6MB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 1.6MB 560kB/s
Collecting wheel>=0.26 (from tensorflow)
  Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 51kB 604kB/s
Collecting protobuf>=3.3.0 (from tensorflow)
  Downloading protobuf-3.4.0-py2.py3-none-any.whl (375kB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 378kB 57kB/s
Collecting numpy>=1.12.1 (from tensorflow)
  Downloading numpy-1.13.3-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.5MB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 4.6MB 200kB/s
Collecting enum34>=1.1.6 (from tensorflow)
  Downloading enum34-1.1.6-py3-none-any.whl
Collecting six>=1.10.0 (from tensorflow)
  Using cached six-1.11.0-py2.py3-none-any.whl
Requirement already up-to-date: werkzeug>=0.11.10 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Requirement already up-to-date: bleach==1.5.0 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Requirement already up-to-date: markdown>=2.6.8 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Requirement already up-to-date: html5lib==0.9999999 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Collecting setuptools (from protobuf>=3.3.0->tensorflow)
  Downloading setuptools-36.7.1-py2.py3-none-any.whl (482kB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 491kB 883kB/s
Installing collected packages: wheel, six, setuptools, protobuf, numpy, tensorflow-tensorboard, enum34, tensorflow
  Found existing installation: wheel 0.29.0
    Uninstalling wheel-0.29.0:
      Successfully uninstalled wheel-0.29.0
  Found existing installation: six 1.10.0
    Uninstalling six-1.10.0:
      Successfully uninstalled six-1.10.0
  Found existing installation: setuptools 36.5.0.post20170921
    Uninstalling setuptools-36.5.0.post20170921:
      Successfully uninstalled setuptools-36.5.0.post20170921
  Found existing installation: protobuf 3.3.2
    Uninstalling protobuf-3.3.2:
      Successfully uninstalled protobuf-3.3.2
  Found existing installation: numpy 1.12.1
    Uninstalling numpy-1.12.1:
      Successfully uninstalled numpy-1.12.1
  Found existing installation: tensorflow 1.1.0
    Uninstalling tensorflow-1.1.0:
      Successfully uninstalled tensorflow-1.1.0
Successfully installed enum34-1.1.6 numpy-1.13.3 protobuf-3.4.0 setuptools-36.7.1 six-1.11.0 tensorflow-1.4.0 tensorflow-tensorboard-0.1.8 wheel-0.30.0
Mon Nov 13 00:40:10 :~$ tensorboard --logdir=/var/folders/bk/2b2d879912bgnl5s768s7crh0000gn/T/tmpzy0cj6xc
Traceback (most recent call last):
  File "/Users/mona/anaconda/bin/tensorboard", line 7, in <module>
    from tensorboard.main import main
  File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorboard/main.py", line 29, in <module>
    import tensorflow as tf
  File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorflow/core/framework/graph_pb2.py", line 10, in <module>
    from google.protobuf import descriptor_pb2
  File "/Users/mona/anaconda/lib/python3.6/site-packages/google/protobuf/descriptor_pb2.py", line 409, in <module>
    options=None),
  File "/Users/mona/anaconda/lib/python3.6/site-packages/google/protobuf/descriptor.py", line 501, in __new__
    return _message.default_pool.FindFieldByName(full_name)
KeyError: "Couldn't find field google.protobuf.DescriptorProto.ExtensionRange.options"
Mon Nov 13 00:40:22 :~$

What should I do now?

I am using Ubuntu 17.10 and I have installed tensorflow and tensorboard as follows: pip3 install --upgrade tensorflow tensorflow-tensorboard
After successful installation when I try using : tensorboard logdir I am getting error "tensorboard: command not found"

I have a small doubt. Does tensorboard work only when GPU Nvidea is present?

@Surya97 Same issue. python -m tensorboard.main --logdir=/your/model/dir solved my problem.

Closing out this issue as @wxp0329 (the OP) seems to have resolved their concern.

For the others posting, please open a new issue specific to your problem if you're still encountering it.

@monajalal - Hmm, I think that might be an issue specific to anaconda python, see https://github.com/tensorflow/tensorflow/issues/12326 for some possible workarounds.

@Surya97 & @secsilm - TensorBoard should work regardless of what GPU you have. The "tensorboard: command not found" error looks like it's from your shell, so it might mean that your $PATH isn't set up correctly to include the tensorboard binary as installed by pip. I'd check your $PATH and if that's still not working, I recommend asking on StackOverflow (with the TensorBoard tag) since more people will see it there, and then filing a new GitHub issue only if you're pretty sure it's a bug in TensorBoard itself versus your specific installation process not working. Thanks!

Traceback (most recent call last):
File "train.py", line 44, in
import tensorboard_logger
ModuleNotFoundError: No module named 'tensorboard_logger'

Was this page helpful?
0 / 5 - 0 ratings