AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'Exporter'

使用

import tensorflow_hub as hub

报错

AttributeError: module ‘tensorflow.python.estimator.estimator_lib’ has no attribute ‘Exporter’

解决:

tensorflow>=1.7.0 才能用 tensorflow_hub

需要先卸载老版本tensorflow

conda uninstall tensorflow
# 或
pip uninstall tensorflow
# 或
conda uninstall tensorflow-gpu
# 或
pip uninstall tensorflow-gpu

重新安装 tensorflow>=1.7.0

pip install tensorflow==1.7

# 或

conda install tensorflow-gpu=1.7 keras

然后

pip install tensorflow-hub

参考:https://stackoverflow.com/questions/49773418/cannot-load-tensorflow-hub

你可能感兴趣的:(报错)