【问题标题】:Cannot load tensorflow_hub无法加载 tensorflow_hub
【发布时间】:2018-09-21 05:47:20
【问题描述】:

写import tensorflow_hub后出现如下错误:

class LatestModuleExporter(tf.estimator.Exporter):

AttributeError: 模块 'tensorflow.python.estimator.estimator_lib' 没有属性 'Exporter'

我在 Windows 10 上使用 python 3.6 和 tensorflow 1.7

谢谢!

【问题讨论】:

    标签: python tensorflow tensorflow-hub


    【解决方案1】:

    你应该至少有 tensorflow 1.7.0,升级:

    pip install "tensorflow>=1.7.0"
    pip install tensorflow-hub
    

    然后:

    pip install tensorflow-hub
    

    来源:here

    【讨论】:

      【解决方案2】:

      您可以重新安装 TensorFlow_hub:

      pip install ipykernel
      
      pip install tensorflow_hub
      

      【讨论】:

        【解决方案3】:

        我相信您的 python3 运行时并没有真正使用 tensorflow 1.7 运行。该属性自 tensorflow 1.4 起就存在。我怀疑 python2/3 环境之间存在一些不匹配,与 pip/pip3 安装不匹配或同时安装 tensorflow 和 tf-nightly pip 包时出现问题。

        您可以仔细检查:

        $ python3 -c "import tensorflow as tf; print(tf.__version__)"
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2020-10-20
          • 1970-01-01
          • 2020-09-04
          • 2018-03-26
          • 1970-01-01
          • 2011-01-24
          • 2010-10-21
          • 1970-01-01
          相关资源
          最近更新 更多