首页 > 解决方案 > Tensorflow 导入错误 AttributeError:“模块”对象没有属性“导出器”

问题描述

当我尝试导入 tensorflow 集线器时,我收到以下错误消息,指出“模块”对象没有属性“导出器”。

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'

标签: pythontensorflow

解决方案


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


推荐阅读