Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'tensorboard.util' has no attribute 'PersistentOpEvaluator' #1724

Closed
smelfungus opened this issue Dec 23, 2018 · 18 comments

Comments

@smelfungus
Copy link

Getting next error on tensorboard launch attempt:

PS C:\Users\user> tensorboard
Traceback (most recent call last):
  File "c:\users\user\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\user\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\users\user\appdata\local\programs\python\python36\Scripts\tensorboard.exe\__main__.py", line 5, in <module>
  File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\tensorboard\main.py", line 45, in <module>
    from tensorboard import default
  File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\tensorboard\default.py", line 38, in <module>
    from tensorboard.plugins.beholder import beholder_plugin
  File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\tensorboard\plugins\beholder\__init__.py", line 15, in <module>
    from tensorboard.plugins.beholder.beholder import Beholder
  File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\tensorboard\plugins\beholder\beholder.py", line 25, in <module>
    from tensorboard.plugins.beholder import im_util
  File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\tensorboard\plugins\beholder\im_util.py", line 89, in <module>
    class PNGDecoder(util.PersistentOpEvaluator):
AttributeError: module 'tensorboard.util' has no attribute 'PersistentOpEvaluator'

Version:

PS C:\Users\user> pip show tensorboard
Name: tensorboard
Version: 1.12.1
Summary: TensorBoard lets you watch Tensors Flow
Home-page: https://github.com/tensorflow/tensorboard
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: c:\users\user\appdata\local\programs\python\python36\lib\site-packages
Requires: werkzeug, markdown, protobuf, six, numpy, grpcio, wheel
Required-by: tensorflow-gpu
  • Windows 10, 64
  • Python version 3.6

Thank you!

@npv14
Copy link

npv14 commented Dec 27, 2018

I solved this problem by trying to merge my tensorboard\plugins folder with https://github.com/tensorflow/tensorboard

@RiteshBM
Copy link

RiteshBM commented Dec 29, 2018

Same Issue , @npv14 's solution didn't work for me.

Would it be correct if I said that there should be a class PersistentOpEvaluator in tensorboard/util.py file?

and there is a class by that name over there, but still it doesn't work for some reason.
Seems like there is something wrong with tensorboard.util. I commented out the parts that called util.PersistentOpEvaluator and now the error is repeated with util.Retrier:-

C:\Users\User>tensorboard
Traceback (most recent call last):
  File "C:\Users\User\Anaconda3\Scripts\tensorboard-script.py", line 10, in <module>
    sys.exit(run_main())
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\main.py", line 48, in run_main
    program.setup_environment()
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\lazy.py", line 49, in __getattr__
    module = self._load()
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\lazy.py", line 38, in _load
    module = importlib.import_module(self.__name__)
  File "C:\Users\User\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 985, in _gcd_import
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 697, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\program.py", line 44, in <module>
    from tensorboard.backend import application
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\backend\application.py", line 37, in <module>
    from tensorboard import db
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\db.py", line 42, in <module>
    class TensorBase(object):
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\db.py", line 48, in TensorBase
    def __init__(self, db_connection_provider, retrier_factory=util.Retrier):
AttributeError: module 'tensorboard.util' has no attribute 'Retrier'

@eelcor
Copy link

eelcor commented Dec 29, 2018

Same issue here. Have been compiling Tensorflow 1.12 myself to work on a Xeon without AVX instructions (but with Cuda). Both compiled Tensorboard and pipped Tensorboard show the same behavior.

@kenpachiii
Copy link

I got it working with the following steps:

  1. pip uninstall tensorflow
  2. pip uninstall tensorboard
  3. go to site-packages and remove tensorflow/tensorboard folders
  4. Reinstalled tensorflow - pip install [whatever wheel package]

You can find the wheel packages here for specific install types:
https://www.tensorflow.org/install/pip

Note: I only stated the specific wheel package because that's what I did.

I know this doesn't explain the 'why' of the issue but it got things going for me. Hope it helps!

@RiteshBM
Copy link

@kenpachiii I reinstalled tensorflow and tensorboard too (using conda however) but it still refuses to work(tried tensorflow-gpu 1.12.0 with tensorboard 1.12.1/1.12.0).

@eelcor
Copy link

eelcor commented Dec 31, 2018 via email

@stephanwlee
Copy link
Contributor

Hello everyone, thanks for reporting the issue. Which version of TensorFlow have you installed?
This can happen if you have tb-nightly installed on your virtualenv then install tensorboard==1.12.x.

Like @kenpachiii put, can you try to delete tensorboad directory in site-packages (Location in pip show tensorboard) then pip install tensorboard==1.12?

@komcat
Copy link

komcat commented Jan 5, 2019

I got same issue. Here is how I fix it by delete tensorboard folder & tensorboard.dist.info and reinstall tensorboard with respective version according to tensorflow.

mine is running
tf-gpu 1.10
win10
python 3.6.4

@NingMingHao
Copy link

Hello everyone, thanks for reporting the issue. Which version of TensorFlow have you installed?
This can happen if you have tb-nightly installed on your virtualenv then install tensorboard==1.12.x.

Like @kenpachiii put, can you try to delete tensorboad directory in site-packages (Location in pip show tensorboard) then pip install tensorboard==1.12?

Thanks, it seems the problem from tb-nightly. I uninstalled tb-nightly and reinstalled the tensorboard.
Finally, it works!!!

@lucventurini
Copy link

lucventurini commented Feb 12, 2019

Another hack to solve it:

First edit your $PYTHONPATH/tensorboard/util/init.py (normally empty) to contain the following:

from .util import *

Second, you should modify the $PYTHONPATH/tensorboard/plugins/beholder/im_util.py file, and change it on line 25 like this:

from

from tensorboard import util

to

from tensorboard import util
from tensorboard.util import op_evaluator

Change then the two classes that inherit from util.PersistentOpEvaluator so that they inherit from op_evaluator:

class PNGDecoder(op_evaluator.PersistentOpEvaluator):
[...]
class Resizer(op_evaluator.PersistentOpEvaluator):

This will take care of the incompatibilities.

@RengXian
Copy link

@lucventurini your solution pop out another error.

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

@wookayin
Copy link

@RengXian Make sure that you don't have tb-nightly installed in your env.

@RengXian
Copy link

@wookayin Thanks a lot! it works just by uninstall the tb-nightly.

@Hayashi-Yudai
Copy link

@kenpachiii, @stephanwlee Thanks a lot. I use anaconda (Python 3.6.7), and installed tensorflow with conda command. I found two versions of tensorboard (1.12 and 1.13) were installed. So I delete both and reinstalled 1.12. As a result, the problem was solved.

@Harshini-Gadige
Copy link

@DummyCo Hi, did you happen to resolve this ? Please keep us posted.

@smelfungus
Copy link
Author

@hgadig yep seems like clean reinstallation of tf and tb resolved the problem, Thanks everyone for sharing 'n attempts!

@Nfreshbird
Copy link

thanks,it do work! use pip show tensorboard and then delete all directories about tensorboard ,next reinstall a lower version of tensorboard (mine is 1.12).

@Kushagra3911
Copy link

Just type pip install tensorboard in the terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests