TensorFlow I/O is a collection of file systems and file formats that are not available in TensorFlow's built-in support.
The TensorFlow I/O package (tensorflow-io
) could be built from source:
$ docker run -it -v ${PWD}:/working_dir -w /working_dir tensorflow/tensorflow:custom-op
$ # In docker
$ ./configure.sh
$ bazel build build_pip_pkg
$ bazel-bin/build_pip_pkg artifacts
A package file artifacts/tensorflow_io-*.whl
will be generated after a build is successful.
Once a package file artifacts/tensorflow_io-*.whl
is ready, installation could be done through:
$ pip install working_dir/artifacts/tensorflow_io-*.whl
The related module could be imported with python:
$ python
Python 2.7.6 (default, Nov 13 2018, 12:45:42)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow_io.kafka import KafkaDataset
>>>
Note that python has to run outside of repo directory itself, otherwise python may not be able to find the correct path to the module.