【问题标题】:Problem importing Tensorflow Hub "module 'tensorflow.tools.docs.doc_controls' has no attribute 'inheritable_header'"导入 Tensorflow Hub 时出现问题“模块‘tensorflow.tools.docs.doc_controls’没有属性‘inheritable_header’”
【发布时间】:2021-12-15 16:52:45
【问题描述】:

我遇到了有关导入 TensorFlow 集线器的问题。以下是在终端中发布的错误。我用的tensorflow的版本是2.6,tensorflow-hub的版本是0.12.0。我使用 pip install 安装了它们。我有点急于完成我的项目,非常感谢您的帮助。

File "/home/bannigo/catkin_ws/src/motorAI_assign/scripts/task1_1.py", line 21, in
import tensorflow_hub as hub
File "/home/bannigo/.local/lib/python3.6/site-packages/tensorflow_hub/init.py", line 
88, in
from tensorflow_hub.estimator import LatestModuleExporter
File "/home/bannigo/.local/lib/python3.6/site-packages/tensorflow_hub/estimator.py",         
line 62, in
class LatestModuleExporter(tf.compat.v1.estimator.Exporter):
File "/home/bannigo/.local/lib/python3.6/site-    
packages/tensorflow/python/util/lazy_loader.py", line 62, in getattr
module = self._load()
File "/home/bannigo/.local/lib/python3.6/site- 
packages/tensorflow/python/util/lazy_loader.py", line 45, in _load
module = importlib.import_module(self.name)
File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/bannigo/.local/lib/python3.6/site-packages/tensorflow_estimator/init.py", 
line 10, in
from tensorflow_estimator._api.v1 import estimator
File "/home/bannigo/.local/lib/python3.6/site- 
packages/tensorflow_estimator/_api/v1/estimator/init.py", line 10, in
from tensorflow_estimator._api.v1.estimator import experimental
File "/home/bannigo/.local/lib/python3.6/site- 
packages/tensorflow_estimator/_api/v1/estimator/experimental/init.py", line 10, in
from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
File "/home/bannigo/.local/lib/python3.6/site- 
packages/tensorflow_estimator/python/estimator/canned/dnn.py", line 27, in
from tensorflow_estimator.python.estimator import estimator
File "/home/bannigo/.local/lib/python3.6/site- 
packages/tensorflow_estimator/python/estimator/estimator.py", line 70, in
@doc_controls.inheritable_header
AttributeError: module 'tensorflow.tools.docs.doc_controls' has no attribute 
'inheritable_header'

【问题讨论】:

    标签: tensorflow python-3.6 tensorflow-hub


    【解决方案1】:

    这是一个已知问题:https://github.com/tensorflow/hub/issues/819。一种临时解决方法是降级tensorflow-estimator

    pip install -U tensorflow-estimator==2.6.0

    【讨论】:

      猜你喜欢
      • 2021-12-16
      • 1970-01-01
      • 2020-07-29
      • 2020-05-01
      • 1970-01-01
      • 2020-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多