Search code examples
pythontensorflowtensorboard

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


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.


Solution

  • 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.