Debugging tensor contents can be quite challenging. For example, you might need to locate a row with extreme values hidden within a string of numbers like [[2.57e-6, 1.04e-3, …, 4.23e-2, 8.34e-3]]. If there was a mistake in preprocessing your image dataset, such as accidental transposition of tensors, it becomes even harder to identify the issue. Once tensors are converted from Pillow, viewing them directly can be difficult, especially if you’re connected via SSH and can’t use Image.show().
To address these challenges, I created TensorHue: GitHub - epistoteles/TensorHue: TensorHue is a Python library that allows you to visualize tensors right in your console, making understanding and debugging tensor contents easier.
TensorHue is an open-source Python library designed for ease of use. It allows you to display tensors (and images) directly in the console with just one line of code:
import tensorhue
TensorHue supports PyTorch, JAX, TensorFlow, Numpy, and Pillow, as well as libraries that depend on them (e.g., torchvision, transformers). It helps you preview image datasets in your console, view color-coded confusion matrices without matplotlib, understand the distribution of your activations, weights, or logits, and more.
TensorHue is still a work in progress—please provide feedback, report issues, contribute with PRs, or give it a star