How do I install TensorFlow's tensorboard?

139,255

Solution 1

The steps to install Tensorflow are here: https://www.tensorflow.org/install/

For example, on Linux for CPU-only (no GPU), you would type this command:

pip install -U pip
pip install tensorflow

Since TensorFlow depends on TensorBoard, running the following command should not be necessary:

pip install tensorboard

Solution 2

Try typing which tensorboard in your terminal. It should exist if you installed with pip as mentioned in the tensorboard README (although the documentation doesn't tell you that you can now launch tensorboard without doing anything else).

You need to give it a log directory. If you are in the directory where you saved your graph, you can launch it from your terminal with something like:

tensorboard --logdir .

or more generally:

tensorboard --logdir /path/to/log/directory

for any log directory.

Then open your favorite web browser and type in localhost:6006 to connect.

That should get you started. As for logging anything useful in your training process, you need to use the TensorFlow Summary API. You can also use the TensorBoard callback in Keras.

Solution 3

If your Tensorflow install is located here:

/usr/local/lib/python2.7/dist-packages/tensorflow

then the python command to launch Tensorboard is:

$ python /usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/tensorboard.py --logdir=/home/user/Documents/.../logdir

The installation from pip allows you to use:

$ tensorboard --logdir=/home/user/Documents/.../logdir

Solution 4

TensorBoard isn't a separate component. TensorBoard comes packaged with TensorFlow.

Solution 5

It may be helpful to make an alias for it.

Install and find your tensorboard location:

pip install tensorboard
pip show tensorboard

Add the following alias in .bashrc:

alias tensorboard='python pathShownByPip/tensorboard/main.py'

Open another terminal or run exec bash.

For Windows users, cd into pathShownByPip\tensorboard and run python main.py from there.

For Python 3.x, use pip3 instead of pip, and don't forget to use python3 in the alias.

Share:
139,255

Related videos on Youtube

Alex_M
Author by

Alex_M

Updated on July 08, 2022

Comments

  • Alex_M
    Alex_M almost 2 years

    How do I install TensorFlow's tensorboard?

    • Charlie Parker
      Charlie Parker over 2 years
      you can do: conda install -y -c conda-forge tensorboard
  • Alex_M
    Alex_M over 8 years
    have you tried it. i wasn't able to run tensorboard. now i have git-cloned the tensorflow repo and i'm trying to build bazel since this seems to be a requirement
  • Mike Harris
    Mike Harris over 8 years
    @Alex_M Yes, that worked for me. TensorBoard was installed as part of Tensorflow, and I was able to run it using python .local/lib/python2.7/site-packages/tensorflow/tensorboard/te‌​nsorboard.py --logdir=tmp
  • dandelion
    dandelion over 8 years
    @Alex_M: Any time you're able to run TensorFlow you should be able to run TensorBoard as well; if you pip installed then you can just use the tensorboard command, but running the tensorboard.py file under tensorflow/tensorboard should work as well.
  • Alex_M
    Alex_M over 8 years
    totally curious. since i was running linux in a vm on windows, i organized today a ssd and installed linux on bare-metal. i pip installed tensorflow and I'm now not able to run tensorboard any more. "hich tensorboard" returns nothing
  • Dave
    Dave about 8 years
    The path has changed slightly since this answer was written. It is now: tensorflow/tensorboard/backend/tensorboard.py (also, pip show tensorflow can be used to get the base directory for a particular machine)
  • xjcl
    xjcl over 5 years
    The man page for conda install says that the -c flag is ignored, what is up with that?
  • wchargin
    wchargin about 5 years
    This answer used to be accurate, but no longer is: the package is now simply called tensorboard, and tensorflow-tensorboard is defunct.
  • becko
    becko about 4 years
    @xjcl If you type man conda install that doesn't open a man page for conda.
  • djstrong
    djstrong about 4 years
    Now, it is separate: pip install tensorboard
  • Vichoko
    Vichoko over 3 years
    I find this answer misleading as tensorflow isn't needed for tensorboard. Many other ML libraries use tensorboard for logging so I wouldn't state tensorflow as a requirement for tensorboard. The correct and simpler response would be directly install tensorboard either with conda or pip, skipping the install of tensorflow.
  • Charlie Parker
    Charlie Parker over 2 years
    what about with conda?
  • Charlie Parker
    Charlie Parker over 2 years
    you can do: conda install -y -c conda-forge tensorboard
  • Charlie Parker
    Charlie Parker over 2 years
    @xjcl it's definitively not ignored in my experience. That is odd. -c conda-forge seems to work most of the time for me.
  • xjcl
    xjcl over 2 years
    @CharlieParker I might have opened the man page for install by accident, apologies