Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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. """)

like image 488
簡亞倫 Avatar asked Nov 01 '21 08:11

簡亞倫


Video Answer


2 Answers

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
like image 70
Khakim Davurov Avatar answered Oct 21 '22 17:10

Khakim Davurov


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

like image 1
Angry_Jew Avatar answered Oct 21 '22 17:10

Angry_Jew