tensorflow / tensorboard-plugin-example

Apache License 2.0
135 stars 59 forks source link

Type error when building example with Python 3.5 #14

Closed JarnoRFB closed 6 years ago

JarnoRFB commented 7 years ago

I installed tf-nightly in a conda env. When trying to build the example I get the error $ bazel run //greeter_plugin:greeter_demo

.........................
INFO: Analysed target //greeter_plugin:greeter_demo (12 packages loaded).
INFO: Found 1 target...
Target //greeter_plugin:greeter_demo up-to-date:
  bazel-bin/greeter_plugin/greeter_demo
INFO: Elapsed time: 5.191s, Critical Path: 0.03s
INFO: Build completed successfully, 1 total action

INFO: Running command line: bazel-bin/greeter_plugin/greeter_demo
Saving output to /tmp/greeter_demo.
Traceback (most recent call last):
  File "/home/jarno/.cache/bazel/_bazel_jarno/4171c5e851722cf65e1e56448c97397b/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 "/home/jarno/.anaconda3/envs/tensorboard/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/home/jarno/.cache/bazel/_bazel_jarno/4171c5e851722cf65e1e56448c97397b/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 "/home/jarno/.cache/bazel/_bazel_jarno/4171c5e851722cf65e1e56448c97397b/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 "/home/jarno/.cache/bazel/_bazel_jarno/4171c5e851722cf65e1e56448c97397b/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 "/home/jarno/projects/tensorboard-live/tensorboard-plugin-example/greeter_plugin/greeter_summary.py", line 61, in op
    content=''))
TypeError: '' has type str, but expected one of: bytes
ERROR: Non-zero return code '1' from command: Process exited with status 1

The output of $ conda env export is

name: tensorboard
channels:
- defaults
dependencies:
- certifi=2016.2.28=py35_0
- openssl=1.0.2l=0
- pip=9.0.1=py35_1
- python=3.5.4=0
- readline=6.2=2
- setuptools=36.4.0=py35_0
- sqlite=3.13.0=0
- tk=8.5.18=0
- wheel=0.29.0=py35_0
- xz=5.2.3=0
- zlib=1.2.11=0
- pip:
  - backports.shutil-get-terminal-size==1.0.0
  - decorator==4.0.9
  - entrypoints==0.2.2
  - enum34==1.1.6
  - ipykernel==4.3.1
  - ipython==4.2.0
  - ipython-genutils==0.1.0
  - ipywidgets==5.1.5
  - jinja2==2.8
  - jsonschema==2.5.1
  - jupyter==1.0.0
  - jupyter-client==4.2.2
  - jupyter-console==4.1.1
  - jupyter-core==4.1.0
  - markupsafe==0.23
  - mistune==0.7.2
  - nbconvert==4.2.0
  - nbformat==4.0.1
  - nbopen==0.3
  - notebook==4.2.0
  - numpy==1.13.1
  - pexpect==4.1.0
  - pickleshare==0.7.2
  - protobuf==3.4.0
  - ptyprocess==0.5.1
  - pygments==2.1.3
  - pyzmq==15.2.0
  - qtconsole==4.2.1
  - simplegeneric==0.8.1
  - six==1.11.0
  - terminado==0.6
  - tf-nightly==1.4.0.dev20170920
  - tornado==4.3
  - traitlets==4.2.1
  - wand==0.4.4
  - widgetsnbextension==1.2.3

This error does not occur when building in an environment with Python 2.7 though.

Akatuoro commented 6 years ago

The content property in SummaryMetadata was changed from string to bytes in commit https://github.com/tensorflow/tensorflow/pull/12867/commits/4d24e6759468006d2325c3ec2944f7a4612caee0 and integrated into tensorflow in version 1.4.0

The temporary solution is to use tensorflow version 1.3