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

I’ve been trying to import tensorflow, downloading Anaconda 3, creating virtual environment, use pip install tensorflow, pip install keras and when I try to import tensorflow an error occured “Failed to load the native TensorFlow runtime.” then I tried to resolve it by downloading cygwin to update the gcc. After that, another error occured

2020-01-21 16:18:17.197417: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-01-21 16:18:17.197832: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

Tried to solve it by downloading CUDA 10.1 version and now the problem is

2020-03-09 14:17:07.528838: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll

This is a problem because after that all process finished with exit code 1 and print(‘test’) cannot even be processed after this.

System information: Anaconda 3 Windows 10 Tensorflow 2.1 Inteil Core I5 Gtx 1050 ti CUDA version 10.1 python version 3.6.1

Describe the problem Describe the problem clearly here. Be sure to convey here why it’s a bug in TensorFlow or a feature request.

The errors when I try to import tensorflow:

2020-03-09 14:17:07.528838: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
Traceback (most recent call last):
  File "C:/Users/User/PycharmProjects/tensortest/test.py", line 1, in <module>
    import tensorflow
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow\__init__.py", line 101, in <module>
    from tensorflow_core import *
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\__init__.py", line 46, in <module>
    from . _api.v2 import compat
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\__init__.py", line 39, in <module>
    from . import v1
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\v1\__init__.py", line 32, in <module>
    from . import compat
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\__init__.py", line 39, in <module>
    from . import v1
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\v1\__init__.py", line 29, in <module>
    from tensorflow._api.v2.compat.v1 import app
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\__init__.py", line 39, in <module>
    from . import v1
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\v1\__init__.py", line 32, in <module>
    from . import compat
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\__init__.py", line 40, in <module>
    from . import v2
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\v2\__init__.py", line 30, in <module>
    from tensorflow._api.v2.compat.v2 import audio
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\v2\__init__.py", line 33, in <module>
    from . import compat
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\v2\compat\__init__.py", line 40, in <module>
    from . import v2
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorflow_core\_api\v2\compat\v2\compat\v2\__init__.py", line 320, in <module>
    from tensorboard.summary._tf import summary
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorboard\summary\__init__.py", line 31, in <module>
    from tensorboard.summary import v2
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorboard\summary\v2.py", line 24, in <module>
    from tensorboard.plugins.audio.summary_v2 import audio
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorboard\plugins\audio\summary_v2.py", line 30, in <module>
    from tensorboard.compat import tf2 as tf
  File "C:\Users\User\Anaconda3\envs\tensortest\lib\site-packages\tensorboard\compat\__init__.py", line 28, in <module>
    import tensorboard.lazy as _lazy
AttributeError: module 'tensorboard' has no attribute 'lazy'

Process finished with exit code 1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 32 (4 by maintainers)

Most upvoted comments

pip uninstall tensorflow-tensorboard pip install tensorboard

had the same problem and this fixed it, hope it helps. Also keep an eye on versions and your virtual env

I have the same problem.

the output of `pip list`:
Package                  Version
------------------------ -----------
absl-py                  0.9.0
astunparse               1.6.3
cachetools               4.1.0
certifi                  2020.6.20
chardet                  3.0.4
gast                     0.3.3
google-auth              1.18.0
google-auth-oauthlib     0.4.1
google-pasta             0.2.0
grpcio                   1.30.0
h5py                     2.10.0
idna                     2.9
Keras-Preprocessing      1.1.2
Markdown                 3.2.2
numpy                    1.19.0
oauthlib                 3.1.0
opt-einsum               3.2.1
pip                      19.2.3
protobuf                 3.12.2
pyasn1                   0.4.8
pyasn1-modules           0.2.8
requests                 2.24.0
requests-oauthlib        1.3.0
rsa                      4.6
scipy                    1.4.1
setuptools               41.2.0
six                      1.15.0
tensorboard              2.2.2
tensorboard-plugin-wit   1.6.0.post3
tensorflow-gpu           2.2.0
tensorflow-gpu-estimator 2.2.0
termcolor                1.1.0
urllib3                  1.25.9
Werkzeug                 1.0.1
wheel                    0.34.2
wrapt                    1.12.1
the output of `pip debug --verbose`:
pip version: pip 19.2.3 from c:\users\ghassen\downloads\lisadetection\lisadetection\venv2\lib\site-packages\pip (python 3.8)
sys.version: 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)]
sys.executable: c:\users\ghassen\downloads\lisadetection\lisadetection\venv2\scripts\python.exe
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: cp1252
sys.platform: win32
sys.implementation:
  name: cpython
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Compatible tags: 15
  cp38-cp38-win_amd64
  cp38-none-win_amd64
  py3-none-win_amd64
  cp38-none-any
  cp3-none-any
  py38-none-any
  py3-none-any
  py37-none-any
  py36-none-any
  py35-none-any
  py34-none-any
  py33-none-any
  py32-none-any
  py31-none-any
  py30-none-any

For import tensorflow as tf this is the output:

2020-06-24 14:50:11.230153: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-06-24 14:50:11.236957: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

and for tf.test.is_gpu_available() the output is:

``` WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version. Instructions for updating: Use `tf.config.list_physical_devices('GPU')` instead. 2020-06-24 14:51:00.146205: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2020-06-24 14:51:00.171655: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x21868deee70 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2020-06-24 14:51:00.182635: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2020-06-24 14:51:00.190956: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll 2020-06-24 14:51:01.031439: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: pciBusID: 0000:01:00.0 name: GeForce GTX 960M computeCapability: 5.0 coreClock: 1.176GHz coreCount: 5 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 74.65GiB/s 2020-06-24 14:51:01.045344: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found 2020-06-24 14:51:01.051842: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found 2020-06-24 14:51:01.058515: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found 2020-06-24 14:51:01.065241: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found 2020-06-24 14:51:01.072266: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found 2020-06-24 14:51:01.080353: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusparse64_10.dll'; dlerror: cusparse64_10.dll not found 2020-06-24 14:51:01.087954: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found 2020-06-24 14:51:01.095638: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1598] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform. Skipping registering GPU devices... 2020-06-24 14:51:01.186835: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-06-24 14:51:01.194906: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0 2020-06-24 14:51:01.198498: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N 2020-06-24 14:51:01.206694: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x21876e35be0 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices: 2020-06-24 14:51:01.214517: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce GTX 960M, Compute Capability 5.0 False ```

I tried also with Tensorboard 2.2.0, the same problem remains

Update your ‘NVIDIA Graphics Driver’ with latest and compatible version for your PC. Download Driver: https://www.nvidia.com/Download/index.aspx# To find out required driver: https://youtu.be/a6ZdiNBPCC8