22.02.2024 Views

Daniel Voigt Godoy - Deep Learning with PyTorch Step-by-Step A Beginner’s Guide-leanpub

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Loading Extension

# Load the TensorBoard notebook extension

%load_ext tensorboard

Then, we run TensorBoard using the newly available magic:

Running TensorBoard

%tensorboard --logdir runs

The magic above tells TensorBoard to look for logs inside the folder specified by the

logdir argument: runs. So, there must be a runs folder in the same location as the

notebook you’re using to train the model. To make things easier for you, I created a

runs folder in the repository, so you get it out-of-the-box.

If you get the error "TypeError: Function expected," please

switch to a modern browser like Firefox or Chrome.

Your notebook will show TensorBoard inside a cell, just like this:

Figure 2.2 - TensorBoard running inside a notebook

TensorBoard | 153

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!