3
votes

Import failing with following error :

C:\Users\bhush>py -3.6-64 Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import tensorflow as tf Traceback (most recent call last): File "", line 1, in File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow__init__.py", line 34, in from tensorflow._api.v1 import compat File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_api\v1\compat__init__.py", line 21, in from tensorflow._api.v1.compat import v1 File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_api\v1\compat\v1__init__.py", line 643, in 'tensorflow_estimator.python.estimator.api._v1.estimator')) File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\tools\component_api_helper.py", line 56, in package_hook child_pkg = importlib.import_module(child_package_str) File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_estimator__init__.py", line 8, in from tensorflow_estimator._api.v1 import estimator File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_estimator_api\v1\estimator__init__.py", line 8, in from tensorflow_estimator._api.v1.estimator import experimental File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_estimator_api\v1\estimator\experimental__init__.py", line 8, in from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_estimator\python\estimator__init__.py", line 25, in import tensorflow_estimator.python.estimator.estimator_lib File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_estimator\python\estimator\estimator_lib.py", line 22, in from tensorflow_estimator.python.estimator.canned.baseline import BaselineClassifier File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_estimator\python\estimator\canned\baseline.py", line 65, in from tensorflow_estimator.python.estimator import estimator File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1708, in class EstimatorV2(Estimator): File "C:\Users\bhush\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1711, in EstimatorV2 export_savedmodel = deprecation.HIDDEN_ATTRIBUTE AttributeError: module 'tensorflow.python.util.deprecation' has no attribute 'HIDDEN_ATTRIBUTE'

I was trying to install tensorflow nightly build. I have CUDA 10 and cuDNN 7.3.0.29. TensortFlow py -3.6–64 -m pip install tf-nightly-gpu

Then I do import tensorflow I get above stack trace. I am trying to understand possible reasons for failure.

3
Please add more context regarding what have you tried and on doing what thing you are getting this error. - Neeraj Sewani
Edited description. - Bhushan Jagtap

3 Answers

3
votes

I had the same error, then I tried doing

pip install tf-nightly-2.0-preview --ignore-installed

It solved this issue, even though I met with others. I think libraries in your environment has version clash, so this should fix your issue, as it won't reinstall installed libraries.

This link might help to find a compatible version of CUDA and Tensorflow.

Nightly build list

2
votes

I had a similar error. You can try pip install -q tensorflow==2.0.0-alpha0

0
votes

Could be an issue with the nightly build on Windows. I could only get this work by reverting back to the last stable GPU build with this command

pip3 install --force-reinstall tensorflow-gpu