TensorBoard Data Server
The `tensorboard-data-server` library, currently at version 0.7.2, provides fast data loading capabilities specifically designed for TensorBoard. It's a key component within the larger TensorBoard ecosystem, optimizing the ingestion and serving of experiment data for visualization. It is released independently but closely aligned with TensorBoard's development, which has a more frequent release cadence.
Warnings
- gotcha The `tensorboard-data-server` version (e.g., 0.7.2) is significantly lower and has an independent release cycle compared to the main `tensorboard` package (e.g., 2.20.0). Do not assume their versions are directly correlated or that features align strictly by version number.
- gotcha The PyPI classification for `tensorboard-data-server` lists its Development Status as '2 - Pre-Alpha'. While it's a dependency of the stable `tensorboard` package, direct programmatic interaction with `tensorboard-data-server` may expose unstable APIs or behaviors.
- gotcha Users on systems with older GLIBC versions (e.g., CentOS 7 with GLIBC_2.17) might encounter 'GLIBC_2.18' not found errors when trying to use the native data server binary. This can cause TensorBoard to fall back to a slower, Python-based log ingester.
- deprecated The TensorBoard.dev hosted service has been shut down. Commands like `tensorboard dev upload` will fail. This is a breaking change for the broader TensorBoard ecosystem that relies on the data server.
Install
-
pip install tensorboard-data-server -
pip install tensorboard # This will also install tensorboard-data-server as a dependency
Imports
- tensorboard_data_server
import tensorboard_data_server
Quickstart
import tensorflow as tf
import datetime
# Create a log directory
log_dir = "logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
writer = tf.summary.create_file_writer(log_dir)
# Log a scalar value
with writer.as_default():
for i in range(100):
tf.summary.scalar("my_metric", i * 0.1, step=i)
writer.flush()
print(f"TensorBoard logs saved to: {log_dir}")
print("To view, run in your terminal: ")
print(f"tensorboard --logdir {log_dir} --load_fast=true")