run test failed
(venv) root@nbser-xxxx-gpu-0:/code/xxxx/workspace/io# TFIO_DATAPATH=bazel-bin python3 -m pytest -s -v tests/test_serialization.py=================================================================== test session starts ==================================================================== platform linux -- Python 3.8.12, pytest-7.1.1, pluggy-1.0.0 -- /code/xxxx/workspace/venv/bin/python3 cachedir: .pytest_cache rootdir: /code/xxxx/workspace/io collected 6 items
tests/test_serialization.py::test_serialization_decode[json] 2022-05-24 15:53:34.680329: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-05-24 15:53:35.257295: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 9653 MB memory: -> device: 0, name: NVIDIA GeForce RTX 2080 Ti, pci bus id: 0000:3d:00.0, compute capability: 7.5 FAILED tests/test_serialization.py::test_serialization_decode[avro] FAILED tests/test_serialization.py::test_serialization_encode[avro] FAILED tests/test_serialization.py::test_serialization_decode_in_dataset[json] FAILED tests/test_serialization.py::test_serialization_decode_in_dataset[avro] FAILED tests/test_serialization.py::test_decode_json_partial_shape FAILED
========================================================================= FAILURES ========================================================================= _____________________________________________________________ test_serialization_decode[json] ______________________________________________________________
fixture_lookup = <function fixture_lookup_func.
@pytest.mark.parametrize(
("serialization_fixture", "decode_function"),
[
pytest.param("json", tfio.experimental.serialization.decode_json),
pytest.param("avro", tfio.experimental.serialization.decode_avro),
],
ids=[
"json",
"avro",
],
)
def test_serialization_decode(fixture_lookup, serialization_fixture, decode_function):
"""test_serialization_decode"""
data, value, specs = fixture_lookup(serialization_fixture)
returned = decode_function(data, specs)
tests/test_serialization.py:133:
tensorflow_io/python/experimental/serialization_ops.py:75: in decode_json values = core_ops.io_decode_json(data, names, dtypes, name=name) tensorflow_io/python/ops/init.py:88: in getattr return getattr(self._load(), attrb) tensorflow_io/python/ops/init.py:84: in _load self._mod = _load_library(self._library)
filename = '/code/xxxx/workspace/io/tensorflow_io/python/ops/init.py', lib = 'op'
def _load_library(filename, lib="op"):
"""_load_library"""
f = inspect.getfile(sys._getframe(1)) # pylint: disable=protected-access
# Construct filename
f = os.path.join(os.path.dirname(f), filename)
filenames = [f]
# Add datapath to load if en var is set, used for running tests where shared
# libraries are built in a different path
datapath = os.environ.get("TFIO_DATAPATH")
if datapath is not None:
# Build filename from:
# `datapath` + `tensorflow_io` + `package_name` + `relpath_to_library`
rootpath = os.path.dirname(sys.modules["tensorflow_io"].__file__)
filename = sys.modules[__name__].__file__
f = os.path.join(
datapath,
"tensorflow_io",
os.path.relpath(os.path.dirname(filename), rootpath),
os.path.relpath(f, os.path.dirname(filename)),
)
filenames.append(f)
# Function to load the library, return True if file system library is loaded
if lib == "op":
load_fn = tf.load_op_library
elif lib == "dependency":
load_fn = lambda f: ctypes.CDLL(f, mode=ctypes.RTLD_GLOBAL)
elif lib == "fs":
load_fn = lambda f: tf.experimental.register_filesystem_plugin(f) is None
else:
load_fn = lambda f: tf.compat.v1.load_file_system_library(f) is None
# Try to load all paths for file, fail if none succeed
errs = []
for f in filenames:
try:
l = load_fn(f)
if l is not None:
return l
except (tf.errors.NotFoundError, OSError) as e:
errs.append(str(e))
raise NotImplementedError(
"unable to open file: "
+ f"{filename}, from paths: {filenames}\ncaused by: {errs}"
)
E NotImplementedError: unable to open file: /code/xxxx/workspace/io/tensorflow_io/python/ops/init.py, from paths: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so'] E caused by: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so: cannot open shared object file: No such file or directory', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so: undefined symbol: ZN10tensorflow13GcsFileSystem12ParseGcsPathEN4absl12lts_2021110211string_viewEbPSsS4']
tensorflow_io/python/ops/init.py:69: NotImplementedError _____________________________________________________________ test_serialization_decode[avro] ______________________________________________________________
fixture_lookup = <function fixture_lookup_func.
@pytest.mark.parametrize(
("serialization_fixture", "decode_function"),
[
pytest.param("json", tfio.experimental.serialization.decode_json),
pytest.param("avro", tfio.experimental.serialization.decode_avro),
],
ids=[
"json",
"avro",
],
)
def test_serialization_decode(fixture_lookup, serialization_fixture, decode_function):
"""test_serialization_decode"""
data, value, specs = fixture_lookup(serialization_fixture)
returned = decode_function(data, specs)
tests/test_serialization.py:133:
tensorflow_io/python/experimental/serialization_ops.py:150: in decode_avro values = core_ops.io_decode_avro(data, names, schema, shapes, dtypes, name=name) tensorflow_io/python/ops/init.py:88: in getattr return getattr(self._load(), attrb) tensorflow_io/python/ops/init.py:84: in _load self._mod = _load_library(self._library)
filename = '/code/xxxx/workspace/io/tensorflow_io/python/ops/init.py', lib = 'op'
def _load_library(filename, lib="op"):
"""_load_library"""
f = inspect.getfile(sys._getframe(1)) # pylint: disable=protected-access
# Construct filename
f = os.path.join(os.path.dirname(f), filename)
filenames = [f]
# Add datapath to load if en var is set, used for running tests where shared
# libraries are built in a different path
datapath = os.environ.get("TFIO_DATAPATH")
if datapath is not None:
# Build filename from:
# `datapath` + `tensorflow_io` + `package_name` + `relpath_to_library`
rootpath = os.path.dirname(sys.modules["tensorflow_io"].__file__)
filename = sys.modules[__name__].__file__
f = os.path.join(
datapath,
"tensorflow_io",
os.path.relpath(os.path.dirname(filename), rootpath),
os.path.relpath(f, os.path.dirname(filename)),
)
filenames.append(f)
# Function to load the library, return True if file system library is loaded
if lib == "op":
load_fn = tf.load_op_library
elif lib == "dependency":
load_fn = lambda f: ctypes.CDLL(f, mode=ctypes.RTLD_GLOBAL)
elif lib == "fs":
load_fn = lambda f: tf.experimental.register_filesystem_plugin(f) is None
else:
load_fn = lambda f: tf.compat.v1.load_file_system_library(f) is None
# Try to load all paths for file, fail if none succeed
errs = []
for f in filenames:
try:
l = load_fn(f)
if l is not None:
return l
except (tf.errors.NotFoundError, OSError) as e:
errs.append(str(e))
raise NotImplementedError(
"unable to open file: "
+ f"{filename}, from paths: {filenames}\ncaused by: {errs}"
)
E NotImplementedError: unable to open file: /code/xxxx/workspace/io/tensorflow_io/python/ops/init.py, from paths: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so'] E caused by: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so: cannot open shared object file: No such file or directory', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so: undefined symbol: ZN10tensorflow13GcsFileSystem12ParseGcsPathEN4absl12lts_2021110211string_viewEbPSsS4']
tensorflow_io/python/ops/init.py:69: NotImplementedError _____________________________________________________________ test_serialization_encode[avro] ______________________________________________________________
fixture_lookup = <function fixture_lookup_func.
@pytest.mark.parametrize(
("serialization_fixture", "encode_function", "decode_function"),
[
pytest.param(
"avro",
tfio.experimental.serialization.encode_avro,
tfio.experimental.serialization.decode_avro,
),
],
ids=[
"avro",
],
)
def test_serialization_encode(
fixture_lookup, serialization_fixture, encode_function, decode_function
):
"""test_serialization_encode"""
_, value, specs = fixture_lookup(serialization_fixture)
returned = encode_function(value, specs)
tests/test_serialization.py:162:
tensorflow_io/python/experimental/serialization_ops.py:176: in encode_avro values = core_ops.io_encode_avro(data, names, schema, name=name) tensorflow_io/python/ops/init.py:88: in getattr return getattr(self._load(), attrb) tensorflow_io/python/ops/init.py:84: in _load self._mod = _load_library(self._library)
filename = '/code/xxxx/workspace/io/tensorflow_io/python/ops/init.py', lib = 'op'
def _load_library(filename, lib="op"):
"""_load_library"""
f = inspect.getfile(sys._getframe(1)) # pylint: disable=protected-access
# Construct filename
f = os.path.join(os.path.dirname(f), filename)
filenames = [f]
# Add datapath to load if en var is set, used for running tests where shared
# libraries are built in a different path
datapath = os.environ.get("TFIO_DATAPATH")
if datapath is not None:
# Build filename from:
# `datapath` + `tensorflow_io` + `package_name` + `relpath_to_library`
rootpath = os.path.dirname(sys.modules["tensorflow_io"].__file__)
filename = sys.modules[__name__].__file__
f = os.path.join(
datapath,
"tensorflow_io",
os.path.relpath(os.path.dirname(filename), rootpath),
os.path.relpath(f, os.path.dirname(filename)),
)
filenames.append(f)
# Function to load the library, return True if file system library is loaded
if lib == "op":
load_fn = tf.load_op_library
elif lib == "dependency":
load_fn = lambda f: ctypes.CDLL(f, mode=ctypes.RTLD_GLOBAL)
elif lib == "fs":
load_fn = lambda f: tf.experimental.register_filesystem_plugin(f) is None
else:
load_fn = lambda f: tf.compat.v1.load_file_system_library(f) is None
# Try to load all paths for file, fail if none succeed
errs = []
for f in filenames:
try:
l = load_fn(f)
if l is not None:
return l
except (tf.errors.NotFoundError, OSError) as e:
errs.append(str(e))
raise NotImplementedError(
"unable to open file: "
+ f"{filename}, from paths: {filenames}\ncaused by: {errs}"
)
E NotImplementedError: unable to open file: /code/xxxx/workspace/io/tensorflow_io/python/ops/init.py, from paths: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so'] E caused by: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so: cannot open shared object file: No such file or directory', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so: undefined symbol: ZN10tensorflow13GcsFileSystem12ParseGcsPathEN4absl12lts_2021110211string_viewEbPSsS4']
tensorflow_io/python/ops/init.py:69: NotImplementedError ________________________________________________________ test_serialization_decode_in_dataset[json] ________________________________________________________
fixture_lookup = <function fixture_lookup_func.
@pytest.mark.parametrize(
("serialization_fixture", "decode_function"),
[
pytest.param("json", tfio.experimental.serialization.decode_json),
pytest.param("avro", tfio.experimental.serialization.decode_avro),
],
ids=[
"json",
"avro",
],
)
def test_serialization_decode_in_dataset(
fixture_lookup, serialization_fixture, decode_function
):
"""test_serialization_decode_in_dataset"""
data, value, specs = fixture_lookup(serialization_fixture)
dataset = tf.data.Dataset.from_tensor_slices([data, data])
dataset = dataset.map(lambda e: decode_function(e, specs))
tests/test_serialization.py:191:
../venv/lib/python3.8/site-packages/tensorflow/python/data/ops/dataset_ops.py:2016: in map return MapDataset(self, map_func, preserve_cardinality=True, name=name) ../venv/lib/python3.8/site-packages/tensorflow/python/data/ops/dataset_ops.py:5191: in init self._map_func = structured_function.StructuredFunctionWrapper( ../venv/lib/python3.8/site-packages/tensorflow/python/data/ops/structured_function.py:271: in init self._function = fn_factory() ../venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py:3070: in get_concrete_function graph_function = self._get_concrete_function_garbage_collected( ../venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py:3036: in _get_concrete_function_garbage_collected graph_function, _ = self._maybe_define_function(args, kwargs) ../venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py:3292: in _maybe_define_function graph_function = self._create_graph_function(args, kwargs) ../venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py:3130: in _create_graph_function func_graph_module.func_graph_from_py_func( ../venv/lib/python3.8/site-packages/tensorflow/python/framework/func_graph.py:1161: in func_graph_from_py_func func_outputs = python_func(*func_args, **func_kwargs) ../venv/lib/python3.8/site-packages/tensorflow/python/data/ops/structured_function.py:248: in wrapped_fn ret = wrapper_helper(*args) ../venv/lib/python3.8/site-packages/tensorflow/python/data/ops/structured_function.py:177: in wrapper_helper ret = autograph.tf_convert(self._func, ag_ctx)(*nested_args)
args = (<tf.Tensor 'args_0:0' shape=() dtype=string>,), kwargs = {} options = <tensorflow.python.autograph.core.converter.ConversionOptions object at 0x7f7ff8146b80>
def wrapper(*args, **kwargs):
"""Wrapper that calls the converted version of f."""
options = converter.ConversionOptions(
recursive=recursive,
user_requested=user_requested,
optional_features=optional_features)
try:
with conversion_ctx:
return converted_call(f, args, kwargs, options=options)
except Exception as e: # pylint:disable=broad-except
if hasattr(e, 'ag_error_metadata'):
raise e.ag_error_metadata.to_exception(e)
E NotImplementedError: in user code:
E
E File "/code/xxxx/workspace/io/tests/test_serialization.py", line 191, in None *
E lambda e: decode_function(e, specs)
E File "/code/xxxx/workspace/io/tensorflow_io/python/experimental/serialization_ops.py", line 75, in decode_json **
E values = core_ops.io_decode_json(data, names, dtypes, name=name)
E File "/code/xxxx/workspace/io/tensorflow_io/python/ops/init.py", line 88, in getattr
E return getattr(self._load(), attrb)
E File "/code/xxxx/workspace/io/tensorflow_io/python/ops/init.py", line 84, in _load
E self._mod = _load_library(self._library)
E File "/code/xxxx/workspace/io/tensorflow_io/python/ops/init.py", line 69, in _load_library
E raise NotImplementedError(
E
E NotImplementedError: unable to open file: /code/xxxx/workspace/io/tensorflow_io/python/ops/init.py, from paths: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so']
E caused by: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so: cannot open shared object file: No such file or directory', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so: undefined symbol: ZN10tensorflow13GcsFileSystem12ParseGcsPathEN4absl12lts_2021110211string_viewEbPSsS4']
../venv/lib/python3.8/site-packages/tensorflow/python/autograph/impl/api.py:692: NotImplementedError
-------------------------------------------------------------------- Captured log call ---------------------------------------------------------------------
WARNING tensorflow:ag_logging.py:142 AutoGraph could not transform <function decode_json at 0x7f7ff8f16700> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, export AUTOGRAPH_VERBOSITY=10) and attach the full output.
Cause: unable to open file: /code/xxxx/workspace/io/tensorflow_io/python/ops/init.py, from paths: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so']
caused by: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so: cannot open shared object file: No such file or directory', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so: undefined symbol: ZN10tensorflow13GcsFileSystem12ParseGcsPathEN4absl12lts_2021110211string_viewEbPSsS4']
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert
________________________________________________________ test_serialization_decode_in_dataset[avro] ________________________________________________________
fixture_lookup = <function fixture_lookup_func.
@pytest.mark.parametrize(
("serialization_fixture", "decode_function"),
[
pytest.param("json", tfio.experimental.serialization.decode_json),
pytest.param("avro", tfio.experimental.serialization.decode_avro),
],
ids=[
"json",
"avro",
],
)
def test_serialization_decode_in_dataset(
fixture_lookup, serialization_fixture, decode_function
):
"""test_serialization_decode_in_dataset"""
data, value, specs = fixture_lookup(serialization_fixture)
dataset = tf.data.Dataset.from_tensor_slices([data, data])
dataset = dataset.map(lambda e: decode_function(e, specs))
tests/test_serialization.py:191:
../venv/lib/python3.8/site-packages/tensorflow/python/data/ops/dataset_ops.py:2016: in map return MapDataset(self, map_func, preserve_cardinality=True, name=name) ../venv/lib/python3.8/site-packages/tensorflow/python/data/ops/dataset_ops.py:5191: in init self._map_func = structured_function.StructuredFunctionWrapper( ../venv/lib/python3.8/site-packages/tensorflow/python/data/ops/structured_function.py:271: in init self._function = fn_factory() ../venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py:3070: in get_concrete_function graph_function = self._get_concrete_function_garbage_collected( ../venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py:3036: in _get_concrete_function_garbage_collected graph_function, _ = self._maybe_define_function(args, kwargs) ../venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py:3292: in _maybe_define_function graph_function = self._create_graph_function(args, kwargs) ../venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py:3130: in _create_graph_function func_graph_module.func_graph_from_py_func( ../venv/lib/python3.8/site-packages/tensorflow/python/framework/func_graph.py:1161: in func_graph_from_py_func func_outputs = python_func(*func_args, **func_kwargs) ../venv/lib/python3.8/site-packages/tensorflow/python/data/ops/structured_function.py:248: in wrapped_fn ret = wrapper_helper(*args) ../venv/lib/python3.8/site-packages/tensorflow/python/data/ops/structured_function.py:177: in wrapper_helper ret = autograph.tf_convert(self._func, ag_ctx)(*nested_args)
args = (<tf.Tensor 'args_0:0' shape=() dtype=string>,), kwargs = {} options = <tensorflow.python.autograph.core.converter.ConversionOptions object at 0x7f7ff29a61c0>
def wrapper(*args, **kwargs):
"""Wrapper that calls the converted version of f."""
options = converter.ConversionOptions(
recursive=recursive,
user_requested=user_requested,
optional_features=optional_features)
try:
with conversion_ctx:
return converted_call(f, args, kwargs, options=options)
except Exception as e: # pylint:disable=broad-except
if hasattr(e, 'ag_error_metadata'):
raise e.ag_error_metadata.to_exception(e)
E NotImplementedError: in user code:
E
E File "/code/xxxx/workspace/io/tests/test_serialization.py", line 191, in None *
E lambda e: decode_function(e, specs)
E File "/code/xxxx/workspace/io/tensorflow_io/python/experimental/serialization_ops.py", line 150, in decode_avro **
E values = core_ops.io_decode_avro(data, names, schema, shapes, dtypes, name=name)
E File "/code/xxxx/workspace/io/tensorflow_io/python/ops/init.py", line 88, in getattr
E return getattr(self._load(), attrb)
E File "/code/xxxx/workspace/io/tensorflow_io/python/ops/init.py", line 84, in _load
E self._mod = _load_library(self._library)
E File "/code/xxxx/workspace/io/tensorflow_io/python/ops/init.py", line 69, in _load_library
E raise NotImplementedError(
E
E NotImplementedError: unable to open file: /code/xxxx/workspace/io/tensorflow_io/python/ops/init.py, from paths: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so']
E caused by: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so: cannot open shared object file: No such file or directory', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so: undefined symbol: ZN10tensorflow13GcsFileSystem12ParseGcsPathEN4absl12lts_2021110211string_viewEbPSsS4']
../venv/lib/python3.8/site-packages/tensorflow/python/autograph/impl/api.py:692: NotImplementedError
-------------------------------------------------------------------- Captured log call ---------------------------------------------------------------------
WARNING tensorflow:ag_logging.py:142 AutoGraph could not transform <function decode_avro at 0x7f7ff8f169d0> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, export AUTOGRAPH_VERBOSITY=10) and attach the full output.
Cause: unable to open file: /code/xxxx/workspace/io/tensorflow_io/python/ops/init.py, from paths: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so']
caused by: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so: cannot open shared object file: No such file or directory', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so: undefined symbol: ZN10tensorflow13GcsFileSystem12ParseGcsPathEN4absl12lts_2021110211string_viewEbPSsS4']
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert
______________________________________________________________ test_decode_json_partial_shape ______________________________________________________________
def test_decode_json_partial_shape():
"""Test case for partial shape GitHub 918."""
r = json.dumps({"foo": [1, 2, 3, 4, 5]})
@tf.function(autograph=False)
def parse_json(json_text):
specs = {"foo": tf.TensorSpec(tf.TensorShape([None]), tf.int32)}
parsed = tfio.experimental.serialization.decode_json(json_text, specs)
return parsed["foo"]
v = parse_json(r)
tests/test_serialization.py:215:
../venv/lib/python3.8/site-packages/tensorflow/python/util/traceback_utils.py:153: in error_handler raise e.with_traceback(filtered_tb) from None tests/test_serialization.py:212: in parse_json parsed = tfio.experimental.serialization.decode_json(json_text, specs) tensorflow_io/python/experimental/serialization_ops.py:75: in decode_json values = core_ops.io_decode_json(data, names, dtypes, name=name) tensorflow_io/python/ops/init.py:88: in getattr return getattr(self._load(), attrb) tensorflow_io/python/ops/init.py:84: in _load self._mod = _load_library(self._library)
filename = '/code/xxxx/workspace/io/tensorflow_io/python/ops/init.py', lib = 'op'
def _load_library(filename, lib="op"):
"""_load_library"""
f = inspect.getfile(sys._getframe(1)) # pylint: disable=protected-access
# Construct filename
f = os.path.join(os.path.dirname(f), filename)
filenames = [f]
# Add datapath to load if en var is set, used for running tests where shared
# libraries are built in a different path
datapath = os.environ.get("TFIO_DATAPATH")
if datapath is not None:
# Build filename from:
# `datapath` + `tensorflow_io` + `package_name` + `relpath_to_library`
rootpath = os.path.dirname(sys.modules["tensorflow_io"].__file__)
filename = sys.modules[__name__].__file__
f = os.path.join(
datapath,
"tensorflow_io",
os.path.relpath(os.path.dirname(filename), rootpath),
os.path.relpath(f, os.path.dirname(filename)),
)
filenames.append(f)
# Function to load the library, return True if file system library is loaded
if lib == "op":
load_fn = tf.load_op_library
elif lib == "dependency":
load_fn = lambda f: ctypes.CDLL(f, mode=ctypes.RTLD_GLOBAL)
elif lib == "fs":
load_fn = lambda f: tf.experimental.register_filesystem_plugin(f) is None
else:
load_fn = lambda f: tf.compat.v1.load_file_system_library(f) is None
# Try to load all paths for file, fail if none succeed
errs = []
for f in filenames:
try:
l = load_fn(f)
if l is not None:
return l
except (tf.errors.NotFoundError, OSError) as e:
errs.append(str(e))
raise NotImplementedError(
"unable to open file: "
+ f"{filename}, from paths: {filenames}\ncaused by: {errs}"
)
E NotImplementedError: unable to open file: /code/xxxx/workspace/io/tensorflow_io/python/ops/init.py, from paths: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so'] E caused by: ['/code/xxxx/workspace/io/tensorflow_io/python/ops/libtensorflow_io.so: cannot open shared object file: No such file or directory', 'bazel-bin/tensorflow_io/python/ops/libtensorflow_io.so: undefined symbol: ZN10tensorflow13GcsFileSystem12ParseGcsPathEN4absl12lts_2021110211string_viewEbPSsS4']
tensorflow_io/python/ops/init.py:69: NotImplementedError ===================================================================== warnings summary ===================================================================== ../venv/lib/python3.8/site-packages/flatbuffers/compat.py:19 /code/xxxx/workspace/venv/lib/python3.8/site-packages/flatbuffers/compat.py:19: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp
../venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:569
/code/xxxx/workspace/venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:569: DeprecationWarning: np.object is a deprecated alias for the builtin object. To silence this warning, use object by itself. Doing this will not modify any behavior and is safe.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
(np.object, string),
../venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:570
/code/xxxx/workspace/venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:570: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
(np.bool, bool),
../venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:594
/code/xxxx/workspace/venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:594: DeprecationWarning: np.object is a deprecated alias for the builtin object. To silence this warning, use object by itself. Doing this will not modify any behavior and is safe.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
types_pb2.DT_STRING: np.object,
../venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:598
/code/xxxx/workspace/venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:598: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
types_pb2.DT_BOOL: np.bool,
../venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:615
/code/xxxx/workspace/venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:615: DeprecationWarning: np.object is a deprecated alias for the builtin object. To silence this warning, use object by itself. Doing this will not modify any behavior and is safe.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
types_pb2.DT_STRING_REF: np.object,
../venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:620
/code/xxxx/workspace/venv/lib/python3.8/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:620: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
types_pb2.DT_BOOL_REF: np.bool,
../venv/lib/python3.8/site-packages/tensorboard/util/tensor_util.py:109
/code/xxxx/workspace/venv/lib/python3.8/site-packages/tensorboard/util/tensor_util.py:109: DeprecationWarning: np.object is a deprecated alias for the builtin object. To silence this warning, use object by itself. Doing this will not modify any behavior and is safe.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
np.object: SlowAppendObjectArrayToTensorProto,
../venv/lib/python3.8/site-packages/tensorboard/util/tensor_util.py:110
/code/xxxx/workspace/venv/lib/python3.8/site-packages/tensorboard/util/tensor_util.py:110: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
np.bool: SlowAppendBoolArrayToTensorProto,
../venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:23 /code/xxxx/workspace/venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:23: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead. 'nearest': pil_image.NEAREST,
../venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:24 /code/xxxx/workspace/venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:24: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead. 'bilinear': pil_image.BILINEAR,
../venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:25 /code/xxxx/workspace/venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:25: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead. 'bicubic': pil_image.BICUBIC,
../venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:28 /code/xxxx/workspace/venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:28: DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead. if hasattr(pil_image, 'HAMMING'):
../venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:29 /code/xxxx/workspace/venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:29: DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead. _PIL_INTERPOLATION_METHODS['hamming'] = pil_image.HAMMING
../venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:30 /code/xxxx/workspace/venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:30: DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead. if hasattr(pil_image, 'BOX'):
../venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:31 /code/xxxx/workspace/venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:31: DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead. _PIL_INTERPOLATION_METHODS['box'] = pil_image.BOX
../venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:33 /code/xxxx/workspace/venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:33: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead. if hasattr(pil_image, 'LANCZOS'):
../venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:34 /code/xxxx/workspace/venv/lib/python3.8/site-packages/keras_preprocessing/image/utils.py:34: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead. _PIL_INTERPOLATION_METHODS['lanczos'] = pil_image.LANCZOS
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ================================================================= short test summary info ================================================================== FAILED tests/test_serialization.py::test_serialization_decode[json] - NotImplementedError: unable to open file: /code/xxxx/workspace/io/tensorflow... FAILED tests/test_serialization.py::test_serialization_decode[avro] - NotImplementedError: unable to open file: /code/xxxx/workspace/io/tensorflow... FAILED tests/test_serialization.py::test_serialization_encode[avro] - NotImplementedError: unable to open file: /code/xxxx/workspace/io/tensorflow... FAILED tests/test_serialization.py::test_serialization_decode_in_dataset[json] - NotImplementedError: in user code: FAILED tests/test_serialization.py::test_serialization_decode_in_dataset[avro] - NotImplementedError: in user code: FAILED tests/test_serialization.py::test_decode_json_partial_shape - NotImplementedError: unable to open file: /code/xxxx/workspace/io/tensorflow_... ============================================================== 6 failed, 18 warnings in 4.14s ============================================================== (venv) root@nbser-xxxx-gpu-0:/code/xxxx/workspace/io#