Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
Facebook introduced PyTorch 1.1 with TensorBoard support. Let’s try it out really quickly on Colab’s Jupyter Notebook.
Not need to install anything locally on your development machine. Google’s Colab cames in handy free of charge even with its upgraded Tesla T4 GPU.
Firstly, let’s create a Colab notebook or open this one I made.
Type in the first cell to check the version of PyTorch is at minimal 1.1.0
import torchtorch.__version__
Then you are going to install the cutting edge TensorBoard build like this.
!pip install -q tb-nightly
The output might remind you to restart the runtime to make the new TensorBoard take effect. You can click through
Runtime -> Restart runtime...
Next, load the TensorBoard notebook extension with this magic line.
%load_ext tensorboard
After which you can start by exploring the TORCH.UTILS.TENSORBOARD API, these utilities let you log PyTorch models and metrics into a directory for visualization within the TensorBoard UI. Scalars, images, histograms, graphs, and embedding visualizations are all supported for PyTorch models and tensors.
The SummaryWriter class is your main entry to log data for consumption and visualization by TensorBoard. Let's run this official demo for MNIST dataset and ResNet50Â model.
You just wrote an image and the model graph data to TensorBoard summary. The writer wrote the output file to “./runs” directory by default.
Let’s run the TensorBoard to visualize them
%tensorboard --logdir=runs
That’s it, you have it!
Summary and Further reading
This really short tutorial gets you to start with running TensorBoard with latest Pytorch 1.1.0 in a Jupyter Notebook. Keep playing around with other features supported with PyTorch TensorBoard.
Read the official API document here — TORCH.UTILS.TENSORBOARD
Originally published at https://www.dlology.com.
How to run Tensorboard for PyTorch 1.1.0 inside Jupyter notebook was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.