Skip to content

tf tensorboard

Tobias Kind edited this page Jan 21, 2018 · 30 revisions

Consider you are sitting as the only person in a nuclear power plant and you want to know what is going on. Instead of debugging each emergency on an old computer in assembler you want to have a convenient overview. Basically working in a more relaxing way.

kursknuclearpp
Kursk NPP / Sergey Pyatakov / CC-BY-SA 3.0

This is where the TensorBoard comes in. It provides a graphical interface to many parameters and one can follow parameters, learning curves and other settings in real-time. Like in a nuclear power plant. In my opinion the use of tensorflow is quite complicated and is surely missing components for easier installation, import of data, control of workflows lets say compared to the H20.ai engine. But maybe tensorflow was not designed for "the masses" in mind, but rather for massively parallel in-house GPU and cluster use.

tensorboard-cifar

The datails of the TensorBoard are outlined in the tf whitepaper. Basically nodes write information to local log files which is then picked up by the external TensorBoard software. Graphical output is then provided on different statistics, such as learning rate, cross-entropies and other figures of merit.

tensorboard-paper

Figure from TensorFlow white paper

To start the external tensorboard application, we simply open a new command line terminal and invoke the help command.

vm@ubuntu:~/tensorflow$ tensorboard --help
usage: tensorboard [-h] [--logdir LOGDIR] [--debug DEBUG] [--nodebug]
                   [--host HOST] [--port PORT]

optional arguments:
  -h, --help       show this help message and exit
  --logdir LOGDIR  logdir specifies where TensorBoard will look to find
                   TensorFlow event files that it can display. In the simplest
                   case, logdir is a directory containing tfevents files.
                   TensorBoard also supports comparing multiple TensorFlow
                   executions: to do this, you can use directory whose
                   subdirectories contain tfevents files, as in the following
                   example: foo/bar/logdir/
                   foo/bar/logdir/mnist_1/events.out.tfevents.1444088766
                   foo/bar/logdir/mnist_2/events.out.tfevents.1444090064 You
                   may also pass a comma seperated list of log directories,
                   and you can assign names to individual log directories by
                   putting a colon between the name and the path, as in
                   tensorboard
                   --logdir=name1:/path/to/logs/1,name2:/path/to/logs/2
  --debug DEBUG    Whether to run the app in debug mode. This increases log
                   verbosity to DEBUG.
  --nodebug
  --host HOST      What host to listen to. Defaults to allowing remote access,
                   set to 127.0.0.1 to serve only on localhost.
  --port PORT      What port to serve TensorBoard on.
vm@ubuntu:~/tensorflow$ tensorboard /tmp/cifar10_train/
usage: tensorboard [-h] [--logdir LOGDIR] [--debug DEBUG] [--nodebug]
                   [--host HOST] [--port PORT]

For specific applications we can then pass the temporary directory using --logdir and start the application by using the /tmp/ path that holds the current running checkpoint or events.out.tfevents files. For the cifar10.py example from tensorflow that would look like this:

vm@ubuntu:~/tensorflow$ tensorboard --logdir /tmp/cifar10_train/
Starting TensorBoard on port 6006
(You can navigate to http://localhost:6006)

Once we conveniently click the provided web address we open a browser window which gives us a web based GUI where we can start to explore and click around.

cifar10-tensorboard


Criticism

The Tensorboard is currently not geared towards general use.

  1. Explanations are missing in the board, what is logloss, what is entropy, when is higher better, when is lower better.
  2. It may break, there are no inbuilt checks to make sure all required plugins are installed prior use.
  3. No instant parameter adjustment possible (aka insert graphite rods) nor regulation of the algorithm possible. Its just for visualization.
  4. For regression, the MSE, RMSE, R2, absolute error are missing (can be added with plugins).
  5. For classification, the confusion matrix (sic), FP, FN, TP, TN. accuracy, sensitivity, specificity are missing (can be added with plugins).

If you are comfortable with yourself to step in as novice such as Homer Simpson to supervise a nuclear power plant or to land a Boeing 777 - Tensorboard is for you. Or you are a full grown expert in deep learning neural networks then maybe too. The missing explanations are surely a big drawback. Similar to the source code of an operating system with all comments stripped away. Not really useful for the masses.

Insertion 2017: The Tensorboard can be used in high abstraction layers, such as Keras callback functions or keras.callbacks.TensorBoard.


Links

  • Live Tensorboard - A life tensorboard for the cifar example with Tesla K20 and K40
  • TB examples - TensorBoardでスカラのグラフを出力する minimum working examples
  • Tensorboard API - Improvements for complex visualizations and plugins (Sept 2017) Google Blog

Clone this wiki locally