46

I want to run tensorboard in jupyter using the latest tensorflow 2.0.0a0. With the tensorboard version 1.13.1, and python 3.6.

using

... %tensorboard --logdir {logs_base_dir}

I get the error :

UsageError: Line magic function %tensorboard not found

Do you have an idea what the problem could be? It seems that all versions are up to date and the command seems correct too.

Thanks

Vlad
  • 8,225
  • 5
  • 33
  • 45
Florida Man
  • 2,021
  • 3
  • 25
  • 43

5 Answers5

84

UPDATE

For newer TF versions (tensorflow>=1.14.0 & tensorflow != 2.0.0a0 - newer than TF2.0-alpha) load the extension like this

%load_ext tensorboard

OLD ANSWER

The extension needs to be loaded first:

%load_ext tensorboard.notebook
%tensorboard --logdir {logs_base_dir}
Vlad
  • 8,225
  • 5
  • 33
  • 45
  • Dear Vlad, thanks. Stupid me, I thought that would only hold for the previous TensorFlow versions. Have a nice day – Florida Man May 03 '19 at 13:33
12

If you are using TF 2.0 you can execute the code below from your notebook environment, prior to your magic command:

%load_ext tensorboard
nimbous
  • 1,507
  • 9
  • 12
5

That's how I solved it

%load_ext tensorboard
%tensorboard --logdir /content/drive/MyDrive/Dog\ Vision/logs

After --logdir, this is my path directory /content/drive/MyDrive/Dog\ Vision/logs. It should be different for you.

Rakibul Islam
  • 61
  • 2
  • 4
1

Year 2020

I needed to pip uninstall both tensorflow and tensorboard

Then install tf-nightly

In order to get this to work

%load_ext tensorboard.notebook
%tensorboard --logdir {logs_base_dir}
Kermit
  • 4,922
  • 4
  • 42
  • 74
0

extension loading is required before. You can try -> %load_ext tensorboard .It worked for me. I am using TensorFlow 1.>

troy
  • 2,145
  • 2
  • 23
  • 31