Launching Tensorboard – NameError: name 'tensorboard' is not defined

Question:

I’m attempting to launch tensorboard and view a graph I created.

import tensorflow as tf

logPath = "C:\path\to\log" -- can also be /path/to/log

sess = tf.Session()
file_writer = tf.summary.FileWriter(logPath, sess.graph)

This code runs fine and creates a event file in the proper folder, but when I run this command in the shell:

tensorboard --logdir /path/to/log

I get the following error:

Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
tensorboard --logdir /path/to/log
NameError: name 'tensorboard' is not defined

Am I missing a setting? I’ve seen the ONE other question with this error but that solution didn’t solve this issue.

I have been able to assign nodes and work purely in the command line okay, I just want to start testing the visualzation.

Many thanks.

Asked By: takethelongsh0t

||

Answers:

From the error message, it looks like you are entering the command tensorboard at the Python shell. However, tensorboard is actually the name of a Windows executable program, and not a Python command.
Therefore, you instead run TensorBoard by entering the same command at the “C:>” Windows Command Prompt.

Answered By: mrry

Have you tried adding to the top of your script:

from keras.callbacks import TensorBoard
Answered By: mostafa.elhoushi

Maybe It could be: you are writing "tensorboard" instead of "TensorBoard"

Answered By: Soltani Nour
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.