python-3.x - 无法导入 tensorflow hub 我收到此错误
问题描述
import tensorflow_hub as hub
我得到错误
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import tensorflow_hub as hub
File "E:\python64bit\lib\site-packages\tensorflow_hub\__init__.py", line 88, in <module>
from tensorflow_hub.estimator import LatestModuleExporter
File "E:\python64bit\lib\site-packages\tensorflow_hub\estimator.py", line 62, in <module>
class LatestModuleExporter(tf.compat.v1.estimator.Exporter):
File "E:\python64bit\lib\site-packages\tensorflow_core\python\util\module_wrapper.py", line 193, in __getattr__
attr = getattr(self._tfmw_wrapped_module, name)
AttributeError: module 'tensorflow._api.v1.compat.v1' has no attribute 'estimator'
解决方案
推荐阅读
- apache-spark - 如何使用 spark 插入 HDFS?
- google-cloud-platform - Ansible gcp_compute 库存插件 - 基于机器名称的组
- android - 生成签名 apk 时出错:请指定签名 apk 的目标文件夹
- powershell - 如何在 Powershell 中同时调用一组 REST API?
- wordpress - WooCommerce 不显示子类别
- php - 如何在 Laravel 中获取查询生成器结果的所有列的数组?
- arrays - 运行时错误 9“下标超出范围”数组 redim 保留 vba
- c - 打印语句不适用于 Mac 的 CodeBlocks
- android - 如何导入 WorkManager 类
- asp.net - 在 ListView ItemTemplate 中设置按钮属性