Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorboard Not Found

I'm trying to use tensorboard dashboard to check the model performance. Below is the code I used:

from keras.callbacks import TensorBoard
%load_ext tensorboard

log_dir = "logs/fit/" + datetime.now().strftime("%Y%m%d-%H%M%S")

tensorboard_callback = TensorBoard(log_dir=log_dir, histogram_freq=1)

checkpoint_name = 'Weights-{epoch:03d}--{val_loss:.5f}.hdf5' 

checkpoint = ModelCheckpoint(checkpoint_name, monitor='val_loss', verbose = 1, save_best_only = True, mode ='auto')

es = EarlyStopping(monitor='val_loss', verbose=1, patience=10)

callbacks_list = [checkpoint ,es,tensorboard_callback]

NN_model.fit(train, target, epochs=100, batch_size=32, validation_split = 0.2, callbacks=callbacks_list)

But after the model training, I could not display the dashboard:

%tensorboard --logdir logs

Here's the error I got:

ERROR: Could not find `tensorboard`. Please ensure that your PATH
contains an executable `tensorboard` program, or explicitly specify
the path to a TensorBoard binary by setting the `TENSORBOARD_BINARY`
environment variable.
like image 838
Yuka Avatar asked Sep 15 '25 21:09

Yuka


1 Answers

It probably happens because of some conflict between notebook and virtual environment.

An easy solution here would be just to specify TENSORBOARD_BINARY variable right in your notebook, so it won't interfere with global variables, before calling tensorboard like that:

os.environ['TENSORBOARD_BINARY'] = '/path/to/envs/my_env/bin/tensorboard'

A longterm solution would be to set up a variable for virtual environment like it was proposed here.

like image 190
Darknessest Avatar answered Sep 17 '25 14:09

Darknessest