11

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 Answers 2

10

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
4
  • 4
    This gave me an AlreadyExistsError: Another metric with the same name already exists.
    – tachsin
    Commented Nov 4, 2021 at 22:52
  • 1
    To be a little more specific here, tensorflow-estimator==2.7.0 uses a decorator from tensorflow that is not introduced until tensorflow==2.7.0. tensorflow==2.6.0 (and presumably all 2.6.x versions), unfortunately, only pins tensorflow-estimator~=2.6, which leaves tfe==2.7.0 to be pulled in. And tfe does not have tensorflow as an explicit dependency of its own, causing the breakdown of semantic versioning we see here. Commented Nov 11, 2021 at 19:19
  • Pranav's edit accounts for the aforementioned AlreadyExistsError. Commented Nov 11, 2021 at 19:28
  • By the way, tensorflow 2.6.2 is released which correctly sets upper limit on tensorflow-estimator version, which fixes these problems. Commented Nov 12, 2021 at 14:13
1

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

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Nov 1, 2021 at 17:02

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.