Search⌘ K
AI Features

TensorBoard

Discover how to integrate and run TensorBoard inside Jupyter notebooks to visualize PyTorch training processes. Learn to set up the environment, manage log directories, and use TensorBoard to track and analyze your model's performance during development.

TensorBoard introduction

TensorBoard is a very useful visualization tool from PyTorch’s competing framework, Tensorflow. And you can use this with PyTorch as well, which provides classes and methods for us to integrate TensorBoard with our model.

Running TensorBoard inside a notebook

First, we need to load Tensorboard’s extension for Jupyter:

Shell
# Load the TensorBoard notebook extension
%load_ext tensorboard

Then, we run Tensorboard using the newly available magic:

Shell
# Running the TensorBoard notebook extension
%tensorboard --logdir runs

The magic above tells TensorBoard to look for logs inside the folder specified by the logdir argument: runs. So, ...