Skip to main content

A fast and intuitive tool for visualizing and analyzing model structures from safetensors files

Project description

TensorKiko

Release TensorKiko

TensorKiko is a powerful and intuitive tool for visualizing and analyzing machine learning model structures. It supports various model formats and provides detailed insights into model architecture, parameters, and tensor statistics.

Features

  • Multi-format Support: Load and process models in .safetensors, .pt, .pth, .pb, and .h5 formats.
  • Interactive Visualization: Generate HTML-based visualizations of model structures with a tree-based layout.
  • Detailed Analysis:
    • Model parameters, memory usage, and estimated FLOPs.
    • Tensor statistics (mean, std dev, min/max values, zero count) with histograms.
    • SVG representation of tensor shapes.
  • Anomaly Detection: Automatically detect and highlight potential issues in model tensors.
  • Search Functionality: Easily navigate large models.
  • Custom Layer Filtering: Include or exclude specific layers using regex patterns.
  • Precision Information: Display the data type of model parameters.
  • Web-based Interface: User-friendly interface with collapsible sections.

UI Examples

Model Overview

TensorKiko Model Overview This image shows the main interface, displaying:

  • Model name and overall details
  • Breakdown of layer types
  • Beginning of the model's hierarchical structure

Layer Details

TensorKiko Layer Details This image demonstrates the detailed view of a specific layer, including:

  • Hierarchical model structure
  • Layer information (parameters, shape, statistics)
  • Histogram of weight distribution

Installation and Usage

Requirements

  • Python 3.11 or higher

Installation

pip install tensorkiko

Basic Usage

tensorkiko path/to/your/model.safetensors

For multiple input files:

tensorkiko path/to/model1.pt path/to/model2.safetensors path/to/model3.h5

Command-line Options

  • --debug: Enable debug mode
  • --no-tree: Disable tree visualization
  • --port PORT: Specify HTTP server port (default: 8000)
  • --output-dir DIR: Set output directory
  • --include-layers REGEX: Include only specific layers
  • --exclude-layers REGEX: Exclude specific layers

Example:

tensorkiko path/to/model.pt --debug --port 8080 --include-layers "conv|linear"

Web Interface Guide

  1. Run TensorKiko on your model(s).
  2. A web browser will open with the visualization.
  3. Explore the collapsible header for model information and layer type statistics.
  4. Click tree nodes to view detailed layer information.
  5. Use the search bar to find specific layers or parameters.
  6. Examine tensor statistics, histograms, and shape visualizations.
  7. Check for highlighted anomalies in the interface.

Contributing

We welcome contributions! Please submit a Pull Request on our GitHub repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.


TensorKiko is developed by the open-source community and takara.ai staff. The project is sponsored by takara.ai.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tensorkiko-0.1.20.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tensorkiko-0.1.20-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file tensorkiko-0.1.20.tar.gz.

File metadata

  • Download URL: tensorkiko-0.1.20.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for tensorkiko-0.1.20.tar.gz
Algorithm Hash digest
SHA256 b636435b261ff71d58666c2cc2c71da94dca53cc0ae56f5c47e2a8653207b544
MD5 9091f6e782682623b4791dab80d2649a
BLAKE2b-256 2dd5c0bee15a64ea5e7250e022fb0958963237f29ce8e770651e52d8fa9c7b9b

See more details on using hashes here.

File details

Details for the file tensorkiko-0.1.20-py3-none-any.whl.

File metadata

  • Download URL: tensorkiko-0.1.20-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for tensorkiko-0.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 5806d75f5a7743dad4eb25f1c71b110ebd773054789d05ec9409aab6ce57ef1f
MD5 03d70ec3fcf517dbd06378f8c631c10c
BLAKE2b-256 5e0b701378f10a46c6adb2cbf6099ad81faab029e1a140057617a2a38fe64650

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page