アプリケーション開発ポータルサイト
ServerNote.NET
Amazon.co.jpでPC関連商品タイムセール開催中!
カテゴリー【Python
【TensorFlow2.6】AttributeError: module tensorflow.tools.docs.doc_controls has no attribute inheritable_headerに対処
POSTED BY
2023-03-22

表題のエラーが出た場合、当方の環境ではtensorflowとtensorflow-estimatorのバージョンが相違していた。

pip3 show tensorflow
Name: tensorflow
Version: 2.6.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: /usr/local/lib/python3.9/dist-packages
Requires: google-pasta, grpcio, wrapt, termcolor, opt-einsum, flatbuffers, protobuf, tensorboard, wheel, numpy, absl-py, astunparse, gast, keras, keras-preprocessing, typing-extensions, tensorflow-estimator, six, h5py, clang
Required-by: tf-models-official, tensorflow-text

pip3 show tensorflow-estimator
Name: tensorflow-estimator
Version: 2.7.0
Summary: TensorFlow Estimator.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: None
License: Apache 2.0
Location: /usr/local/lib/python3.9/dist-packages
Requires:
Required-by: tensorflow

tensorflow-estimatorをダウングレード

pip3 install --upgrade tensorflow-estimator==2.6.0
Collecting tensorflow-estimator==2.6.0
  Downloading tensorflow_estimator-2.6.0-py2.py3-none-any.whl (462 kB)
     |????????????????????????????????| 462 kB 9.1 MB/s
Installing collected packages: tensorflow-estimator
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow 2.6.0 requires keras~=2.6, which is not installed.
Successfully installed tensorflow-estimator-2.6.0

pip3 show tensorflow-estimator
Name: tensorflow-estimator
Version: 2.6.0
Summary: TensorFlow Estimator.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: None
License: Apache 2.0
Location: /home/hogeuser/.local/lib/python3.9/site-packages
Requires:
Required-by: tensorflow

これで当該エラーは無くなるが、kerasの問題が残るので以下に続く。

【TensorFlow2.6】AlreadyExistsError: Another metric with the same name already existsとModuleNotFoundError: No module named kerasに同時対処

※本記事は当サイト管理人の個人的な備忘録です。本記事の参照又は付随ソースコード利用後にいかなる損害が発生しても当サイト及び管理人は一切責任を負いません。
※本記事内容の無断転載を禁じます。
【WEBMASTER/管理人】
自営業プログラマーです。お仕事ください!
ご連絡は以下アドレスまでお願いします★

☆ServerNote.NETショッピング↓
ShoppingNote / Amazon.co.jp
☆お仲間ブログ↓
一人社長の不動産業務日誌
【キーワード検索】