Module 'tensorflow.tools.docs.doc_controls' has no attribute 'inheritable_header'

6.4k Views Asked by At

Running estimator from tensorflow today and came up with this error, any idea how to solve it?

File "C:\Users\ASUS Laptop\anaconda3\envs\tf_gpu\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 70, in <module>
    @doc_controls.inheritable_header("""\
AttributeError: module 'tensorflow.tools.docs.doc_controls' has no attribute 'inheritable_header'

This is in my estimator.py file: @doc_controls.inheritable_header("""
Warning: Estimators are not recommended for new code. Estimators run v1.Session-style code which is more difficult to write correctly, and can behave unexpectedly, especially when combined with TF 2 code. Estimators do fall under our compatibility guarantees, but will receive no fixes other than security vulnerabilities. See the migration guide for details. """)

2

There are 2 best solutions below

4
Khakim Davurov On

Check your tensorflow-estimator version, it seems that version 2.7 from the 30 of October not compatible with some libraries.

try version 2.6:

pip install --upgrade tensorflow-estimator==2.6.0

EDIT:- Also downgrade keras to version 2.6.0:

pip install --upgrade keras==2.6.0
1
Angry_Jew On

Either upgrade or downgrade tensorflow-estimator package to match tensorflow version.