TensorBoard Data Server

0.7.2 · active · verified Sun Mar 29

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

Install

Imports

Quickstart

The `tensorboard-data-server` is typically leveraged automatically by `tensorboard`. This example shows how to generate logs and then start TensorBoard, explicitly enabling the fast data server. The `--load_fast=true` flag instructs TensorBoard to use the Rust-based data server for improved performance.

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")

view raw JSON →