tensorflow / tensorboard-plugin-example

Apache License 2.0
135 stars 59 forks source link

'PluginData' object has no attribute 'add' #7

Closed elliotwaite closed 7 years ago

elliotwaite commented 7 years ago

Received the following error when running: bazel run //greeter_plugin:greeter_demo

Elliots-MacBook-Pro:tensorboard-plugin-example elliotwaite$ bazel run //greeter_plugin:greeter_demo
.................
INFO: Found 1 target...
Target //greeter_plugin:greeter_demo up-to-date:
  bazel-bin/greeter_plugin/greeter_demo
INFO: Elapsed time: 4.640s, Critical Path: 0.02s

INFO: Running command line: bazel-bin/greeter_plugin/greeter_demo
Saving output to /tmp/greeter_demo.
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_elliotwaite/e7d113ace6c2e85facdc8977fe0f5005/execroot/io_github_tensorflow_tensorboard_plugin_example/bazel-out/local-fastbuild/bin/greeter_plugin/greeter_demo.runfiles/io_github_tensorflow_tensorboard_plugin_example/greeter_plugin/greeter_demo.py", line 71, in <module>
    tf.app.run()
  File "/Users/elliotwaite/miniconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/private/var/tmp/_bazel_elliotwaite/e7d113ace6c2e85facdc8977fe0f5005/execroot/io_github_tensorflow_tensorboard_plugin_example/bazel-out/local-fastbuild/bin/greeter_plugin/greeter_demo.runfiles/io_github_tensorflow_tensorboard_plugin_example/greeter_plugin/greeter_demo.py", line 66, in main
    run_all(LOGDIR, verbose=True)
  File "/private/var/tmp/_bazel_elliotwaite/e7d113ace6c2e85facdc8977fe0f5005/execroot/io_github_tensorflow_tensorboard_plugin_example/bazel-out/local-fastbuild/bin/greeter_plugin/greeter_demo.runfiles/io_github_tensorflow_tensorboard_plugin_example/greeter_plugin/greeter_demo.py", line 59, in run_all
    run(logdir, "steven_universe", ["Garnet", "Amethyst", "Pearl"], "Steven")
  File "/private/var/tmp/_bazel_elliotwaite/e7d113ace6c2e85facdc8977fe0f5005/execroot/io_github_tensorflow_tensorboard_plugin_example/bazel-out/local-fastbuild/bin/greeter_plugin/greeter_demo.runfiles/io_github_tensorflow_tensorboard_plugin_example/greeter_plugin/greeter_demo.py", line 37, in run
    summary_op = greeter_summary.op("greetings", input_)
  File "/Users/elliotwaite/code/tensorboard-plugin-example/greeter_plugin/greeter_summary.py", line 58, in op
    summary_metadata.plugin_data.add(plugin_name=PLUGIN_NAME, content="")
AttributeError: 'PluginData' object has no attribute 'add'
ERROR: Non-zero return code '1' from command: Process exited with status 1.

Proposed fix here: https://github.com/tensorflow/tensorboard-plugin-example/pull/6

axelv commented 7 years ago

The same bug is probably the cause of a second exception. I used fix proposed byb @elliotwaite and the first bazel command bazel run //greeter_plugin:greeter_demo executed without further errors. The second command bazel run //greeter_tensorboard -- --logdir=/tmp/greeter_demo caused a another error probably due to the same bug:

Exception in thread Reloader:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/private/var/tmp/_bazel_root/73e68435275d047f49371c8b74f92018/execroot/io_github_tensorflow_tensorboard_plugin_example/bazel-out/darwin_x86_64-fastbuild/bin/greeter_tensorboard/greeter_tensorboard.runfiles/org_tensorflow_tensorboard/tensorboard/backend/application.py", line 316, in _reload_forever
    reload_multiplexer(multiplexer, path_to_run)
  File "/private/var/tmp/_bazel_root/73e68435275d047f49371c8b74f92018/execroot/io_github_tensorflow_tensorboard_plugin_example/bazel-out/darwin_x86_64-fastbuild/bin/greeter_tensorboard/greeter_tensorboard.runfiles/org_tensorflow_tensorboard/tensorboard/backend/application.py", line 290, in reload_multiplexer
    multiplexer.Reload()
  File "/private/var/tmp/_bazel_root/73e68435275d047f49371c8b74f92018/execroot/io_github_tensorflow_tensorboard_plugin_example/bazel-out/darwin_x86_64-fastbuild/bin/greeter_tensorboard/greeter_tensorboard.runfiles/org_tensorflow_tensorboard/tensorboard/backend/event_processing/event_multiplexer.py", line 189, in Reload
    accumulator.Reload()
  File "/private/var/tmp/_bazel_root/73e68435275d047f49371c8b74f92018/execroot/io_github_tensorflow_tensorboard_plugin_example/bazel-out/darwin_x86_64-fastbuild/bin/greeter_tensorboard/greeter_tensorboard.runfiles/org_tensorflow_tensorboard/tensorboard/backend/event_processing/event_accumulator.py", line 239, in Reload
    self._ProcessEvent(event)
  File "/private/var/tmp/_bazel_root/73e68435275d047f49371c8b74f92018/execroot/io_github_tensorflow_tensorboard_plugin_example/bazel-out/darwin_x86_64-fastbuild/bin/greeter_tensorboard/greeter_tensorboard.runfiles/org_tensorflow_tensorboard/tensorboard/backend/event_processing/event_accumulator.py", line 372, in _ProcessEvent
    for plugin_data in value.metadata.plugin_data:
TypeError: 'PluginData' object is not iterable' 

Comparing the code in 'event_accumulator.py' with the version in the tensorboard repository, I think it should be updated. I don't know bazel enough to include a newer version of the tensorboard package.

chihuahua commented 7 years ago

@axelv, #9 fixes this. Thank you for noting!