When I try to
import tensorflow - io as tfio
I get the erorr:
File "/home/somedir/miniconda3/envs/env_name/lib/python3.8/site-packages/tensorflow_io/core/python/ops/__init__.py", line 65, in _load_library raise NotImplementedError( NotImplementedError: unable to open file: libtensorflow_io.so, from paths: ['/home/somedir/miniconda3/envs/env_name/lib/python3.8/site-packages/tensorflow_io/core/python/ops/libtensorflow_io.so'] caused by: ['/home/somedir/miniconda3/envs/env_name/lib/python3.8/site-packages/tensorflow_io/core/python/ops/libtensorflow_io.so undefined symbol: _ZN10tensorflow0pKernel11TraceStringEPNS_150pKernelContextEb ']
6 frames /usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/func_graph.py in autograph_handler(*args, **kwargs) 1127 except Exception as e: # pylint:disable=broad-except 1128 if hasattr(e, “ag_error_metadata”): → 1129 raise e.ag_error_metadata.to_exception(e) 1130 else: 1131 raise,Hi, am running YAMNet for environmental sound classification, and I am getting an error today that I don’t get two days ago, any suggestions? and seems the problems is related to Tensorflow-IO,great! this is the solution !pip install tensorflow_io==0.23.1,But the thing is 3 days ago was working ok, so I am very interested in reaching the TensorFlow team out, seems a new update or something like that is generating that issue.
NotImplementedError: in user code:
File "<ipython-input-11-e741e9a3c44d>", line 30, in load_wav_16k_mono *
wav = tfio.audio.resample(wav, rate_in=sample_rate, rate_out=16000)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_io/python/ops/audio_ops.py", line 462, in resample **
value = tf.vectorized_map(f, input)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_io/python/ops/audio_ops.py", line 458, in f
return core_ops.io_audio_resample(
File "/usr/local/lib/python3.7/dist-packages/tensorflow_io/python/ops/__init__.py", line 88, in __getattr__
return getattr(self._load(), attrb)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_io/python/ops/__init__.py", line 84, in _load
self._mod = _load_library(self._library)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_io/python/ops/__init__.py", line 71, in _load_library
+ f"{filename}, from paths: {filenames}\ncaused by: {errs}"
NotImplementedError: unable to open file: libtensorflow_io.so, from paths: ['/usr/local/lib/python3.7/dist-packages/tensorflow_io/python/ops/libtensorflow_io.so']
caused by: ['/usr/local/lib/python3.7/dist-packages/tensorflow_io/python/ops/libtensorflow_io.so: undefined symbol: _ZN10tensorflow4data11DatasetBase8FinalizeEPNS_15OpKernelContextESt8functionIFNS_8StatusOrISt10unique_ptrIS1_NS_4core15RefCountDeleterEEEEvEE']
Because main.c made a specific reference to the interface provided by libfoo.so, prog really has a dependency on libfoo.so. However, only explicit shared object dependencies are recorded in the output file being generated. Thus, prog fails to run if a new version of libbar.so is developed that no longer has a dependency on libfoo.so.,Weak symbol references that remain unresolved, do not result in a fatal error condition, no matter what output file type is being generated., Historically, these undefined weak referenced symbols have been employed as a mechanism to test for the existence of functionality. For example, the following C code fragment might have been used in the shared object libfoo.so.1.,When the link-editor is generating a shared object output file, undefined symbols are allowed to remain at the end of the link-edit. This default behavior allows the shared object to import symbols from a dynamic executable that defines the shared object as a dependency.
$ cat main.c
extern int foo();
int main() {
return (foo());
}
$ cc - o prog main.c
Undefined first referenced
symbol in file
foo main.o
ld: fatal: Symbol referencing errors.No output written to prog
$ cat foo.c
extern int bar;
int foo() {
return (bar);
}
$ cc - o libfoo.so - G - K pic foo.c
$ cc - o prog main.c - L. - lfoo
Undefined first referenced
symbol in file
bar. / libfoo.so
ld: fatal: Symbol referencing errors.No output written to prog
$ cat bar.c
int bar = 1;
$ cc - o libbar.so - R. - G - K pic bar.c - L. - lfoo
$ ldd libbar.so
libfoo.so => . / libfoo.so
$ cc - o prog main.c - L. - lbar
Undefined first referenced
symbol in file
foo main.o(symbol belongs to implicit\ dependency. / libfoo.so)
ld: fatal: Symbol referencing errors.No output written to prog
#pragma weak foo
extern void foo(char * );
void bar(char * path) {
void( * fptr)(char * );
if ((fptr = foo) != 0)
( * fptr)(path);
}
pip 卸载 tensorflow-io pip 安装 tensorflow-gpu pip install --no-deps tensorflow-io,正如@Smedegaard 提到的, tensorflow_io 不在 conda forge 上。 answer of vlasenkoalexey on Github issues 来解决这个问题:,看起来 tensorflow_io 还没有在 conda forge 上: https://github.com/tensorflow/io/issues/676 ,明显的解决方法是卸载 tensorflow 和 tensorflow-io 并从 pip 安装它们: pip 卸载张量流
当我尝试
import tensorflow - io as tfio
我得到了错误:
File "/home/somedir/miniconda3/envs/env_name/lib/python3.8/site-packages/tensorflow_io/core/python/ops/__init__.py", line 65, in _load_library raise NotImplementedError( NotImplementedError: unable to open file: libtensorflow_io.so, from paths: ['/home/somedir/miniconda3/envs/env_name/lib/python3.8/site-packages/tensorflow_io/core/python/ops/libtensorflow_io.so'] caused by: ['/home/somedir/miniconda3/envs/env_name/lib/python3.8/site-packages/tensorflow_io/core/python/ops/libtensorflow_io.so undefined symbol: _ZN10tensorflow0pKernel11TraceStringEPNS_150pKernelContextEb ']