io icon indicating copy to clipboard operation
io copied to clipboard

tensorflow-io cannot be used with tf compiled with --config=monolithic

Open kretes opened this issue 4 years ago • 1 comments

When compiling custom wheel for tf with --config=monolithic - the resulting tf wheel doesn't have 'libtensorflow_framework.so.2'. This version of tf, although perfectly fine for other purposes - cannot be used together with tensorflow-io.

Environment: The environment is built such that we first install custom tf whell and then we install tensorflow-io with --no-deps option, not to get stock tensorflow overwrite custom one. tensorflow compiled at version 2.6.0 tensorflow-io 0.21.0

At runtime we receive the following error:

/root/.cache/pypoetry/virtualenvs/deeplearning-CRl2NYz6-py3.8/lib/python3.8/site-packages/tensorflow_io/python/ops/__init__.py:98: UserWarning: unable to load libtensorflow_io_plugins.so: unable to open file: libtensorflow_io_plugins.so, from paths: ['/root/.cache/pypoetry/virtualenvs/deeplearning-CRl2NYz6-py3.8/lib/python3.8/site-packages/tensorflow_io/python/ops/libtensorflow_io_plugins.so']
caused by: ['libtensorflow_framework.so.2: cannot open shared object file: No such file or directory']
  warnings.warn("unable to load libtensorflow_io_plugins.so: {}".format(e))
/root/.cache/pypoetry/virtualenvs/deeplearning-CRl2NYz6-py3.8/lib/python3.8/site-packages/tensorflow_io/python/ops/__init__.py:104: UserWarning: file system plugins are not loaded: unable to open file: libtensorflow_io.so, from paths: ['/root/.cache/pypoetry/virtualenvs/deeplearning-CRl2NYz6-py3.8/lib/python3.8/site-packages/tensorflow_io/python/ops/libtensorflow_io.so']
caused by: ['libtensorflow_framework.so.2: cannot open shared object file: No such file or directory']
  warnings.warn("file system plugins are not loaded: {}".format(e))

If we compile without --config=monolithic - the version doesn't give error on import.

However at runtime we get:

NotImplementedError: unable to open file: libtensorflow_io.so, from paths: ['/root/.cache/pypoetry/virtualenvs/deeplearning-CRl2NYz6-py3.8/lib/python3.8/site-packages/tensorflow_io/python/ops/libtensorflow_io.so']
caused by: ['/root/.cache/pypoetry/virtualenvs/deeplearning-CRl2NYz6-py3.8/lib/python3.8/site-packages/tensorflow_io/python/ops/libtensorflow_io.so: undefined symbol: _ZNK10tensorflow4data15DatasetOpKernel11TraceStringERKNS_15OpKernelContextEb']

Exactly same testing process but with stock tf passes, so this is not something inherent to the way we test it

Is there any guide on what should be included in the tf wheel/compilation so that it can be used with tf-ioaccident?

kretes avatar Sep 28 '21 10:09 kretes

Same error when I trying to access hdfs bytf.io.gfile.exists

Lifann avatar Nov 13 '21 13:11 Lifann