Python Tensorflow导入错误AttributeError:&x27;模块';对象没有属性';出口商';

Python Tensorflow导入错误AttributeError:&x27;模块';对象没有属性';出口商';,python,tensorflow,Python,Tensorflow,当我尝试导入tensorflow hub时,我得到以下错误,即“模块”对象没有属性“导出器” AttributeErrorTraceback (most recent call last) <ipython-input-1-31fb71834c8c> in <module>() 1 # Install TF-Hub. 2 import tensorflow as tf ----> 3 import tensorflow_hub as hub

当我尝试导入tensorflow hub时,我得到以下错误,即“模块”对象没有属性“导出器”

AttributeErrorTraceback (most recent call last)
<ipython-input-1-31fb71834c8c> in <module>()
      1 # Install TF-Hub.
      2 import tensorflow as tf
----> 3 import tensorflow_hub as hub
      4 import matplotlib.pyplot as plt
      5 import numpy as np

/usr/local/lib/python2.7/dist-packages/tensorflow_hub/__init__.py in <module>()
     24 import tensorflow as tf
     25 
---> 26 from tensorflow_hub.estimator import LatestModuleExporter
     27 from tensorflow_hub.estimator import register_module_for_export
     28 from tensorflow_hub.feature_column import image_embedding_column

/usr/local/lib/python2.7/dist-packages/tensorflow_hub/estimator.py in <module>()
     59 
     60 
---> 61 class LatestModuleExporter(tf.estimator.Exporter):
     62   """Regularly exports registered modules into timestamped directories.
     63 

AttributeError: 'module' object has no attribute 'Exporter'
AttributeErrorTraceback(最近一次调用上次)
在()
1#安装TF轮毂。
2导入tensorflow作为tf
---->3导入tensorflow_hub作为hub
4导入matplotlib.pyplot作为plt
5作为np进口numpy
/usr/local/lib/python2.7/dist-packages/tensorflow\u-hub/\uuuuu-init\uuuuu.py-in()
24导入tensorflow作为tf
25
--->26来自tensorflow_hub.estimator导入最新模块导出器
27来自tensorflow\u hub.estimator导入寄存器\u模块\u导出
28从tensorflow\u hub.feature\u列导入图像\u嵌入\u列
/usr/local/lib/python2.7/dist-packages/tensorflow_hub/estimator.py in()
59
60
--->61类最新模块导出器(tf.estimator.Exporter):
62“”定期将注册模块导出到带时间戳的目录中。
63
AttributeError:“模块”对象没有属性“导出器”

这是由于旧版本的tensorflow造成的。应该是>1.7

尝试更新tensorflow\u hub。
pip安装-升级tensorflow\u hub
@不再升级\u stackoverflow更新的tensorflow\u hub仍然没有解决问题。可能是由于python 2版本?