Search code examples
pythonpython-3.xtensorflowkerastensorboard

AttributeError: module 'tensorboard.util' has no attribute 'PersistentOpEvaluator' , when trying to use TensorBoard


I made some log files using tensorboard but I can't access them.

Using

tensorboard or tensorboard --logdir=logs/ on the command prompt

gives the following error:-

C:\Users\User>tensorboard
Traceback (most recent call last):
  File "C:\Users\User\Anaconda3\Scripts\tensorboard-script.py", line 6, in <module>
    from tensorboard.main import run_main
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\main.py", line 40, in <module>
    from tensorboard import default
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\default.py", line 38, in <module>
    from tensorboard.plugins.beholder import beholder_plugin
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\plugins\beholder\__init__.py", line 15, in <module>
    from tensorboard.plugins.beholder.beholder import Beholder
  File "C:\Users\User\Anaconda3\lib\site-packages\tensorboard\plugins\beholder\beholder.py", line 25, in <module>
    from tensorboard.plugins.beholder import im_util
  File "C:\Users\User\Anaconda3\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'

I tried this solution, but it did not help.


Solution

  • I also had a big fight with this problem. What eventually worked for me was the following:

    1. pip uninstall tensorflow
    2. pip uninstall tensorboard
    3. conda show OR pip show --> have a look at which other tensorflow related packages you have installed and remove them.
    4. Go to site-packages and remove tensorflow/tensorboard folders (look for any folder in your filesystem related to a tensorflow / tensorboard installation)
    5. conda clean --all (not sure if this is necessary, but it was one of my steps and might be relevant)
    6. Reinstall tensorflow and tensorboard. Preferably use conda as it is faster by several orders of magnitude

    One of my main sources in solving this issue was this github issue thread: https://github.com/tensorflow/tensorboard/issues/1724