Tensorflow NotFoundError:libtensorflow_framework.so:无法打开共享文件或目录 [英] Tensorflow NotFoundError: libtensorflow_framework.so: cannot open shared file or directory
问题描述
我在 Linux 的 Ubuntu 16.04 版本的 Windows 子系统中使用 Tensorflow 1.14.0(通过 pip 安装)和 Python 2.7.我正在运行另一个人编写的脚本,它给了我以下错误:
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
我发现了这篇文章,其中用户发现丢失的 libtensorflow_framework.so 文件本身,我导航到 /usr/local/lib/python2.7/dist-packages/tensorflow
在那里我找到了一个 lib_tensorflow_framework.so.1 文件.我尝试重命名文件以删除最后的 .1 并尝试重新运行脚本,但随后出现错误,提示找不到 .so.1 文件!如果我运行 find .-name libtensorflow_framework.so
没有结果.我在哪里可以找到这个文件?
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?
推荐答案
不要重命名文件,将符号链接从 libtensorflow_framework.so 添加到 libtensorflow_framework.so.1
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
这篇关于Tensorflow NotFoundError:libtensorflow_framework.so:无法打开共享文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!