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

notebook.mddocs/

Notebook Integration

TensorBoard provides utilities for seamless integration with interactive notebook environments including Jupyter notebooks and Google Colab. The notebook module automatically detects the runtime environment and provides appropriate display methods for each context.

Capabilities

TensorBoard Launch

Start a TensorBoard instance from within a notebook environment with automatic context detection.

def start(args_string):
    """
    Launch TensorBoard in notebook environment.
    
    Args:
        args_string (str): Command-line arguments as a single string
                          (same format as tensorboard CLI)
    
    Automatically detects and handles:
    - Google Colab environments
    - Jupyter notebook environments  
    - IPython shell environments
    - Standard CLI environments
    """

TensorBoard Display

Display a running TensorBoard instance within the notebook interface.

def display(port=None, height=None):
    """
    Display running TensorBoard instance in notebook.
    
    Args:
        port (int, optional): TensorBoard server port. If None, attempts
                             to auto-detect running instance
        height (int, optional): Frame height in pixels (default 800)
    
    Provides environment-specific display:
    - Colab: Embedded iframe with proxy URL handling
    - Jupyter: Local iframe integration
    - CLI: Prints URL for manual access
    """

Instance Management

List and manage running TensorBoard instances.

def list():
    """
    List all known running TensorBoard instances.
    
    Returns:
        Information about active TensorBoard processes including
        ports, PIDs, start times, and data sources
    """

IPython Extension Loading

Integration with IPython's extension system for magic commands.

def load_ipython_extension(ipython):
    """
    Deprecated: use '%load_ext tensorboard' instead.
    
    Args:
        ipython: IPython.InteractiveShell instance
        
    Raises:
        RuntimeError: Always, directing users to correct usage
    """

Usage Examples

Basic Notebook Usage

import tensorboard.notebook as tb_notebook

# Launch TensorBoard with log directory
tb_notebook.start('--logdir ./logs')

# Display in notebook (auto-detects port)
tb_notebook.display()

Advanced Configuration

import tensorboard.notebook as tb_notebook

# Launch with multiple options
tb_notebook.start('--logdir ./experiments --port 6007 --reload_interval 30')

# Display with custom height
tb_notebook.display(port=6007, height=1000)

# List running instances
running_instances = tb_notebook.list()
print(f"Found {len(running_instances)} TensorBoard instances")

IPython Magic Commands

After loading the TensorBoard extension, magic commands become available:

# Load the extension (run once per session)
%load_ext tensorboard

# Use magic command to launch TensorBoard
%tensorboard --logdir ./logs --port 6006

Environment-Specific Behavior

The notebook module automatically adapts to different environments:

Google Colab:

  • Uses Colab's proxy system for secure external access
  • Handles authentication and URL rewriting automatically
  • Displays TensorBoard in embedded iframe

Jupyter Notebook:

  • Creates local iframe pointing to TensorBoard server
  • Handles port forwarding if needed
  • Integrates with Jupyter's display system

IPython/CLI:

  • Prints clickable URLs for manual browser access
  • Provides terminal-friendly output formatting
  • Maintains compatibility with non-browser environments

Context Detection

The module uses the following detection logic:

  1. Colab Detection: Checks for google.colab module and IPython kernel
  2. Jupyter Detection: Checks for IPython instance with kernel trait
  3. CLI Fallback: Falls back to command-line behavior for other environments

This ensures TensorBoard works consistently across different development environments while providing the best possible user experience for each context.

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