使用

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

Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐