Tensorflow NotFoundError: libtensorflow_framework.so: cannot open shared file or directory

Question:

I am using Tensorflow 1.14.0 (installed with pip) with Python 2.7 in Ubuntu 16.04 version of Windows Subsystem for Linux. I am running a script that another person has written and it gives me the following error:

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/load_library.py", line 61, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: libtensorflow_framework.so: cannot open shared object file: No such file or directory

I found this post in which the user found the missing libtensorflow_framework.so file themselves, and I navigated to /usr/local/lib/python2.7/dist-packages/tensorflow where I found a lib_tensorflow_framework.so.1 file. I tried renaming the file to remove the .1 at the end and tried rerunning the script, but then got errors saying it couldn’t find the .so.1 file! If I run find . -name libtensorflow_framework.so there are no results. Where can I find this file?

Asked By: Alex Yefimov

||

Answers:

the libtensorflow_framework.so maybe not exist. Perhaps you can try find . -name libtensorflow_framework.so1

Answered By: Yehua_Zhang

Don’t rename the file, add the symlink from libtensorflow_framework.so to libtensorflow_framework.so.1

cd /usr/local/lib/python2.7/dist-packages/tensorflow/

# If you renamed the file, rename it back
mv libtensorflow_framework.so libtensorflow_framework.so.1

# Create a symlink so both .so and .so.1 point to the same file
ln -s libtensorflow_framework.so.1 libtensorflow_framework.so
Answered By: William D. Irons

Downgrading tensorflow_io to an older version resolved this issue for me. If you are still encountering this error I would suggest that.

Answered By: meowmeow
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.