CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-tensorboard

TensorBoard is a suite of web applications for inspecting and understanding your TensorFlow runs and graphs

Overview
Eval results
Files

index.mddocs/

TensorBoard

TensorBoard is a suite of web applications for inspecting, analyzing, and understanding machine learning models and training processes. It provides interactive dashboards for monitoring scalar metrics, visualizing computational graphs, exploring high-dimensional embeddings, analyzing histograms and distributions, debugging models, profiling performance, and examining image/audio/text data samples. The platform supports both real-time monitoring during training and post-hoc analysis with a plugin architecture for custom visualization extensions.

Package Information

  • Package Name: tensorboard
  • Language: Python
  • Installation: pip install tensorboard

Core Imports

import tensorboard

For accessing specific functionality:

from tensorboard import errors, notebook, program, summary

Direct access to the main TensorBoard application:

from tensorboard.program import TensorBoard

Summary operations (conditionally available, requires TensorFlow):

# Only available if TensorFlow is installed
try:
    from tensorboard.summary.v2 import scalar, histogram, image, audio, text
except ImportError:
    # v2 API not available without TensorFlow
    pass

Basic Usage

Launch TensorBoard Server

from tensorboard.program import TensorBoard

# Create and configure TensorBoard application
tb = TensorBoard()
tb.configure(argv=['--logdir', './logs', '--port', '6006'])

# Launch the server
tb.launch()

Summary Writing (TensorFlow Required)

# Summary operations require TensorFlow installation
try:
    from tensorboard.summary.v2 import scalar, histogram, image
    import numpy as np

    # Write scalar metrics
    scalar('loss', 0.1, step=1)
    scalar('accuracy', 0.95, step=1)

    # Write histogram data
    weights = np.random.normal(0, 1, 1000)
    histogram('model/weights', weights, step=1)

    # Write image data
    image_data = np.random.rand(1, 28, 28, 1)  # NHWC format
    image('generated_images', image_data, step=1)
except ImportError:
    print("TensorFlow required for summary operations")

Notebook Integration

import tensorboard.notebook as tb_notebook

# Launch TensorBoard in notebook (Jupyter/Colab)
tb_notebook.start('--logdir ./logs --port 6006')

# Display the TensorBoard interface
tb_notebook.display(port=6006, height=800)

Architecture

TensorBoard consists of several key components:

  • Frontend: Web-based dashboard with plugin architecture for visualizations
  • Backend: HTTP server that reads log data and serves visualization content
  • Summary API: Python API for writing structured data to TensorBoard logs
  • Plugin System: Extensible architecture supporting custom visualization types
  • Manager: Process lifecycle management for running TensorBoard instances

The plugin system enables specialized visualizations for different data types (scalars, histograms, images, text, etc.) while maintaining a consistent interface for data ingestion and display.

Capabilities

Error Handling

Structured exception hierarchy with HTTP-aware error classes for web application error handling and user-facing error messages.

class PublicError(RuntimeError): ...
class InvalidArgumentError(PublicError): ...
class NotFoundError(PublicError): ...
class UnauthenticatedError(PublicError): ...
class PermissionDeniedError(PublicError): ...

Error Handling

Notebook Integration

Utilities for using TensorBoard in interactive notebook environments including Jupyter notebooks and Google Colab with automatic context detection and display management.

def start(args_string: str): ...
def display(port=None, height=None): ...
def list(): ...

Notebook Integration

Program Interface

Command-line application interface and server management functionality for launching and configuring TensorBoard instances with customizable plugins and server options.

class TensorBoard:
    def __init__(plugins=None, assets_zip_provider=None, server_class=None): ...
    def configure(**kwargs): ...
    def main(argv=None): ...
    def launch(): ...

Program Interface

Summary Operations

TensorBoard's summary module provides access to summary writing infrastructure and re-exports v1/v2 summary APIs (when TensorFlow is available).

# Core writer classes (always available)
class Writer: ...
class Output: ...
class DirectoryOutput(Output): ...

# V2 API re-exports (requires TensorFlow)
from tensorboard.summary.v2 import *  # Conditional import

# V1 API re-exports (requires TensorFlow) 
from tensorboard.summary.v1 import *  # Conditional import

Summary Operations

Process Management

Programmatic control over TensorBoard server instances including startup, monitoring, and shutdown with support for instance reuse and process tracking.

class TensorBoardInfo: ...
class StartLaunched: ...
class StartReused: ...
def start(arguments, timeout=60): ...
def get_all(): ...

Process Management

IPython Extension

def load_ipython_extension(ipython):
    """
    IPython API entry point for loading TensorBoard magic commands.
    
    Args:
        ipython: IPython.InteractiveShell instance
        
    Note: Only intended to be called by the IPython runtime.
    """

This function enables TensorBoard magic commands in Jupyter notebooks via %load_ext tensorboard.

Version Information

__version__: str  # Current version string (e.g., "2.20.0")

The __version__ attribute provides access to the currently installed TensorBoard version for compatibility checking and debugging purposes. The version string corresponds to the value in tensorboard.version.VERSION.

Install with Tessl CLI

npx tessl i tessl/pypi-tensorboard

docs

errors.md

index.md

manager.md

notebook.md

program.md

summary.md

tile.json