Tensorboard: Running on Google Cloud found : No module named tensorflow.tensorboard

Created on 21 Aug 2017  路  6Comments  路  Source: tensorflow/tensorboard

I've followed this sample https://cloud.google.com/ml-engine/docs/how-tos/getting-started-training-prediction by running python -m tensorflow.tensorboard --logdir=$MODEL_DIR --port=8080.
I have got this error : /usr/bin/python: No module named tensorflow.tensorboard
How should I do? I can't find any solution via google.

Most helpful comment

Sorry, my mistake鈥擨 should have written tensorboard.main instead of TensorBoard:

python -m tensorboard.main --logdir "${MODEL_DIR}" --port 8080

Does this work?

All 6 comments

Could you try using python -m tensorboard --logdir "${MODEL_DIR}" --port 8080 instead? I suspect that this will fix your issue.

(As of TensorFlow 1.3, TensorBoard code is available as tensorboard.* instead of tensorflow.tensorboard.*.)

Please let us know if this fixes the issue, so that we can update the docs.

It doesn't work. It return error as :
/usr/bin/python: No module named tensorboard.__main__; 'tensorboard' is a package and cannot be directly executed

Sorry, my mistake鈥擨 should have written tensorboard.main instead of TensorBoard:

python -m tensorboard.main --logdir "${MODEL_DIR}" --port 8080

Does this work?

It return this error :
veeda_ch@cloudshell:~/cloudml-samples-master/census/estimator$ python -m tensorboard.main --logdir=output --port=8080
W0822 08:46:38.819151 Reloader event_accumulator.py:303] Found more than one graph event per run, or there was a metagraph containing a graph_def, as well as one or more gra
ph events. Overwriting the graph with the newest event.
W0822 08:46:38.859276 Reloader event_accumulator.py:311] Found more than one metagraph event per run. Overwriting the metagraph with the newest event.
W0822 08:46:38.862222 Reloader event_accumulator.py:303] Found more than one graph event per run, or there was a metagraph containing a graph_def, as well as one or more gra
ph events. Overwriting the graph with the newest event.
W0822 08:46:38.863882 Reloader event_accumulator.py:311] Found more than one metagraph event per run. Overwriting the metagraph with the newest event.
W0822 08:46:39.038057 Reloader event_accumulator.py:303] Found more than one graph event per run, or there was a metagraph containing a graph_def, as well as one or more gra
ph events. Overwriting the graph with the newest event.
W0822 08:46:39.055238 Reloader event_accumulator.py:311] Found more than one metagraph event per run. Overwriting the metagraph with the newest event.
TensorBoard 0.1.4 at http://cs-6000-devshell-vm-65897b58-a94a-4403-9d60-b8a53e9b855c-4f:8080 (Press CTRL+C to quit) ^C

Right, okay. So TensorBoard is working properly, but you have bad data. It looks like you wrote multiple TensorBoard runs into the same directory, with something like

$ cat my_script.py
import tensorflow as tf
writer = tf.summary.FileWriter("./output")
summary = tf.summary.scalar(321.0)
with tf.Session() as sess:
  writer.add_graph(sess.graph)
  writer.add_summary(sess.run(summary))
writer.close()
$ python my_script.py
$ python my_script.py  # now you have conflicting data!!

TensorBoard is behaving as expected. The easiest way to resolve this is to ensure that you are writing to distinct directories with each FileWriter. If you're careful, you can ensure the looser condition that across all FileWriters for a single directory you only call add_graph once, and each time you call add_summary you pass a globally unique value for global_step.

@chihuahua can close this

  • although i use can launch tensorboard 'python -m tensorboard.main --logdir "${MODEL_DIR}" --port 8080'
  • but i meet another proble: it load file failed

  • and the flie is in the exist

Was this page helpful?
0 / 5 - 0 ratings