【问题标题】:Tensorflow.io module is missing - how do I get gfile?缺少 Tensorflow.io 模块 - 我如何获取 gfile?
【发布时间】:2020-02-02 05:09:36
【问题描述】:

我正在尝试使用tensorflow.io.gfile 模块来加载推理图。当我尝试导入 gfile 模块时,我可以进入 GFile 类,我得到以下结果:

>>> import tensorflow
>>> from tensorflow.io import gfile
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow.io'

No module named 'tensorflow.io'
>>> tensorflow.__version__
'2.0.0'

我在 MacOS Catalina 上使用 Python 3.7.4。

如果tensorflow.io 的子模块丢失,如何成功导入?

https://www.tensorflow.org/api_docs/python/tf/io/gfile/GFile

【问题讨论】:

    标签: tensorflow


    【解决方案1】:
    pip install tensorflow.io
    

    应该能解决问题。

    答案取决于假设您使用的是 TF2.0,其中此功能已移至单独的包中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-18
      • 2021-10-02
      • 2015-01-08
      • 2015-01-26
      • 2014-12-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多