libtensorflow_framework.so issue
yunoJ opened this issue · comments
Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): I git cloned it from https://github.com/smallcorgi/Faster-RCNN_TF.git
- OS Platform and Distribution: ubuntu 18.04
- TensorFlow installed from: pip install
- TensorFlow version: used both 1.14.0rc and 1.14.0(gpu)
- Python version: 2.7
- GCC/Compiler version: 7.4
- CUDA/cuDNN version: 10.0
- GPU model and memory: GV 100
My script file is demo.py.
Here's the back trace
Traceback (most recent call last):
File "./tools/demo.py", line 11, in <module>
from networks.factory import get_network
File "/home/tFaster-RCNN_TF/tools/../lib/networks/__init__.py", line 8, in <module>
from .VGGnet_train import VGGnet_train
File "/home/Faster-RCNN_TF/tools/../lib/networks/VGGnet_train.py", line 2, in <module>
from networks.network import Network
File "/home/Faster-RCNN_TF/tools/../lib/networks/network.py", line 3, in <module>
import roi_pooling_layer.roi_pooling_op as roi_pool_op
File "/homeFaster-RCNN_TF/tools/../lib/roi_pooling_layer/roi_pooling_op.py", line 5, in <module>
_roi_pooling_module = tf.load_op_library(filename)
File "/home/.local/lib/python2.7/site-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 checked that libtensorflow_framework.so is in python2.7/site-packages/tensorflow/
but somehow my program doesn't seem to be able to find it. The path for the tensorflow library is set as $TF_LIB = /home/.local/lib/python2.7/site-packages/tensorflow
I did run into some solutions but coudn't find one with tf version 1.14.0.
Please help.
Thanks in advance.
Hi @yunoJ,
does it work if you specify the full path in library_name
? Otherwise you might be able to fix this by adding the directory of your libtensorflow_framwork to your LD_LIBRARY_PATH
.
Thank you @PhilJd,
Appending the LD_LIBRARY_PATH worked for me. Well, for the libtensorflow_framework.so at least. I guess I should just keep adding directories for every .so file I use.
Please,let me know if we can close this issue since it looks to be fixed. Thanks!
Oh, the problem is fixed. I will close the issue, thanks!
can you specify where to append i faced the same issue with python 3.6 tensorflow
You need to run the command
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path/to/your/libtensorflow"
Thanks but after trying it i amgetting error undefined symbol: _ZTVN10tensorflow14kernel_factory17OpKernelRegistrar18PtrOpKernelFactoryE
When people (like myself) come from python to java world, everything is strange! here is how I solved my problem regarding all linking errors:
I assumed you already have simple hello Tensorflow project, explained here
First:
- Download and copy tensorflow JNI files to :/usr/lib/tensorflow
- Download and copy desired version of tensorflow Lib jar file to: /usr/lib/tensorflow
Compile with java
- Compile java file
javac -cp /usr/lib/tensorflow/libtensorflow-1.14.0.jar HelloTensorFlow.java
- run java file:
java -cp /usr/lib/tensorflow/libtensorflow-1.14.0.jar:. -Djava.library.path=/usr/lib/tensorflow/ HelloTensorFlow
MAVEN
- First we should export LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=/usr/lib/tensorflow
- Then run maven build command:
mvn -q compile exec:java
I hope it helps you
Hi, Sorry for commenting on the closed issue. I tried to append the libtensorflow path, but again getting the same error. How can I know the correct path of libtensorflow.
@chanchalIITP , run this to get the path of your libtensorflow:
find . -name libtensorflow_framework.so2
@chanchalIITP : Are you able to solve the error? I am also facing the same issue. Kindly help.
@AASHISHAG, find . -name libtensorflow_framework.so2 works for finding the path of .so file. In my case, actually the .so file is not generated. It generally happens if the tensorflow and gcc is not compatible.
Concluding: I am also not able to solve it. You may check the compatibility of CUDA, Tensorflow, and gcc.
@chanchalIITP , run this to get the path of your libtensorflow:
find . -name libtensorflow_framework.so2
The above mis-spells the file name. Try:
find . -name libtensorflow_framework.so.2
i hope the problem is with the tensorflow version so try to change the versionand reinstall the tensorflow version
You need to run the command
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path/to/your/libtensorflow"
Hello, what is the situation after I change the path and enter this command does not respond?