Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Torch Model Viewer

Visualize PyTorch weights in 1D, 2D & 3D — instantly!

A 2-file, zero-install web dashboard to explore .pth / .pt models.
No training, no setup — just drop in your model and see every layer in colorful, interactive 3D.

Screenshot_2025-11-05_10-42-56Screenshot_2025-11-05_10-45-59Screenshot_2025-11-05_10-50-56 ---

Features

FeatureDescription
3D Point CloudRed = low values, Blue = high values, Size scales with magnitude
2D HeatmapFull-resolution layer view (auto-scaled)
1D Line ChartRaw weight values (sampled)
HistogramDistribution of values per layer
Smart IndicatorsOverfit, dead weights, extreme values
Dark Mode UIClean, collapsible panels

Quick Start

# 1. Clone & enter
git clone https://github.com/jdwebprogrammer/torch-model-viewer.git
cd torch-model-dashboard
# 2. Install (once)
pip install flask torch pillow numpy
# 3. Run!
python app.py

Open http://127.0.0.1:5000Upload your .pth or .pt file → Explore!


How It Works

  • Backend (app.py): Loads model → extracts weights → computes stats, heatmaps, 3D layouts
  • Frontend (templates/index.html): Three.js + Chart.js → interactive 3D orbit + responsive UI
  • Smart Sampling: Up to 10,000 points per layer → smooth performance even on huge models

Why Use It?

  • Spot dead neurons (all red, tiny)
  • Find exploding gradients (huge blue points)
  • Compare layer patterns across models
  • Debug quantization, pruning, or training bugs

Project Structure

torch-model-dashboard/
├── app.py Flask + Torch backend
├── templates/
│ └── index.html Three.js + Chart.js frontend
└── README.md

License

MIT — Free to use, modify, and share.


> Made with **love** for the PyTorch community > *“See your weights. Understand your model.”*

About

Torch Model Viewer - Easily load and view your torch (.pth) pre-trained models for viewing in 1D, 2D and 3D.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages