Tensorboard: AttributeError: module 'tensorboard' has no attribute 'lazy'

Created on 16 Feb 2019  路  9Comments  路  Source: tensorflow/tensorboard

  • Tensorboard version: 1.12.2
  • Tensorflow version: tf-nightly-2.0-preview==2.0.0.dev20190216
  • OS: MacOS Mojave
  • Python version: 3.6.5

Training a simple model with tf.keras in the latest tf-nightly-2.0-preview will result in the following error even without using any Tensorboard callback during training:

Traceback (most recent call last): File "/Users/thms/.virtualenvs/tf2/bin/tensorboard", line 6, in <module> from tensorboard.main import run_main File "/Users/thms/.virtualenvs/tf2/lib/python3.6/site-packages/tensorboard/main.py", line 45, in <module> from tensorboard import default File "/Users/thms/.virtualenvs/tf2/lib/python3.6/site-packages/tensorboard/default.py", line 34, in <module> import tensorflow as tf File "/Users/thms/.virtualenvs/tf2/lib/python3.6/site-packages/tensorflow/__init__.py", line 30, in <module> from tensorflow._api.v2 import compat File "/Users/thms/.virtualenvs/tf2/lib/python3.6/site-packages/tensorflow/_api/v2/compat/__init__.py", line 22, in <module> from tensorflow._api.v2.compat import v2 File "/Users/thms/.virtualenvs/tf2/lib/python3.6/site-packages/tensorflow/_api/v2/compat/v2/__init__.py", line 306, in <module> "Limited tf.compat.v2.summary API due to missing TensorBoard " File "/Users/thms/.virtualenvs/tf2/lib/python3.6/site-packages/tensorflow/python/tools/component_api_helper.py", line 56, in package_hook child_pkg = importlib.import_module(child_package_str) File "/Users/thms/.virtualenvs/tf2/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/Users/thms/.virtualenvs/tf2/lib/python3.6/site-packages/tensorboard/summary/__init__.py", line 32, in <module> from tensorboard.summary import v2 File "/Users/thms/.virtualenvs/tf2/lib/python3.6/site-packages/tensorboard/summary/v2.py", line 24, in <module> from tensorboard.plugins.audio.summary_v2 import audio File "/Users/thms/.virtualenvs/tf2/lib/python3.6/site-packages/tensorboard/plugins/audio/summary_v2.py", line 30, in <module> from tensorboard.compat import tf2 as tf File "/Users/thms/.virtualenvs/tf2/lib/python3.6/site-packages/tensorboard/compat/__init__.py", line 28, in <module> import tensorboard.lazy as _lazy AttributeError: module 'tensorboard' has no attribute 'lazy'

Is there a specific tensorboard build to use with the TF2.0 preview?

Most helpful comment

if using pip, somehow the order of tensorflow-tensorboard and tensorboard matter...

pip install tensorflow-tensorboard==1.5.1

then

pip install tensorboard==1.14.0

this will be solved

All 9 comments

At this point only the nightly build of TensorBoard (tb-nightly) is compatible with the TF 2.0 preview, 1.12.2 is not expected to work. If you just install tf-nightly-2.0-preview alone in a fresh virtualenv it should install a compatible tb-nightly.

I also had trouble reproducing this error, with the same setup except High Sierra instead of Mojave which I doubt makes a difference here - I hit an error at AttributeError: module 'tensorflow._api.v2.train' has no attribute 'SessionRunHook' instead. Is it possible you had tb-nightly installed as well as 1.12.2? They both provide the tensorboard package so if both are installed you might be in an indeterminate state.

Yes I pip installed tensorboard separately indeed. I didn't see it was installing tb-nightly at the same time!
Thanks for your response!

Okay, great. I'll go ahead and close this since it sounds like that worked for you.

I've found this issue to also occur with TensorFlow 1.14, and was able to resolve it by installing tb-nightly.

if using pip, somehow the order of tensorflow-tensorboard and tensorboard matter...

pip install tensorflow-tensorboard==1.5.1

then

pip install tensorboard==1.14.0

this will be solved

@lenjoy: The tensorflow-tensorboard distribution is a relic of a
bygone era; there鈥檚 no need to install it anymore. As noted on the PyPI page

NOTICE: This PyPI entry has been deprecated in favor of the
tensorboard name found at https://pypi.python.org/pypi/tensorboard
for TensorBoard 1.6.0+. Only bugfix updates on 1.5.x will be applied
to this old package name.

To upgrade past the version shown on this page, please ensure that you
_first_ pip uninstall tensorflow-tensorboard and then pip install tensorboard.

@wchargin , got it. thanks! it works!

@wchargin Thanks I was looking for this answer. This thing worked for me.

@wchargin Thanks for this!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

datlife picture datlife  路  4Comments

OverLordGoldDragon picture OverLordGoldDragon  路  3Comments

yegortokmakov picture yegortokmakov  路  3Comments

wchargin picture wchargin  路  3Comments

smatsumori picture smatsumori  路  4Comments