Tensorboard (experimental) in PyTorch 1.1

In the latest release (v1.1), PyTorch officially introduced the much-loved visualization tool, Tensorboard. Although it is an experimental version and might change in the near future, I think this is awesome.

Upgrade PyTorch version 1.0.x

pip install --upgrade torch

Install Tensorboard

pip install tb-nightly

That’s it. You are good to go. Import the SummaryWriter and begin visualization :)

from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter(log_dir='./logs')# Track variables (e.g. loss, kld, etc.) that change
writer.add_scalar('KL Divergence', kl_div)
writer.add_scalar('Total Loss', loss)
writer.add_text('Decoder output', 'Some output')

To view the output, in terminal execute the following,

tensorboard --logdir=logs

Fire up your browser and point to

PyTorch 1.1 with Tensorboard ❤

For details, check out the documentation.

Artificial Intelligence Researcher | Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store