Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 610
Alex Yefimov Avatar asked Jul 04 '19 13:07

Alex Yefimov


2 Answers

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
like image 112
William D. Irons Avatar answered Sep 22 '22 14:09

William D. Irons


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

like image 30
Yehua_Zhang Avatar answered Sep 21 '22 14:09

Yehua_Zhang