Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow.io module is missing - how do I get gfile?

Tags:

tensorflow

I'm trying to use the tensorflow.io.gfile module to load an inference graph. When I try to import the gfile module, so I can get to the GFile class, I get the following results:

>>> 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'

I'm on MacOS Catalina with Python 3.7.4.

How can I successfully import sub-modules of tensorflow.io if it's missing?

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


1 Answers

pip install tensorflow.io

Should solve the problem.

The answer relies on the assumption that you are using TF2.0, in which this functionality has been moved to a separate package.

like image 79
y.selivonchyk Avatar answered May 17 '26 04:05

y.selivonchyk