Issue
I followed the instructions of this tutorial:
rel="noreferrer">https://www.tensorflow.org/extend/adding_an_op#implement_the_gradient_in_python.
There is this comment provided: g++ -std=c++11 -shared zero_out.cc -o zero_out.so -fPIC -I$TF_INC -I$TF_INC/external/nsync/public -L$TF_LIB -ltensorflow_framework -O2
But the linker cannot find -ltensorflow_framework
(it should be a tensorflow_frameowork.so file!?)
After some research, I found following links:
- https://github.com/tensorflow/tensorflow/issues/1569
- https://github.com/eaplatanios/tensorflow_scala/issues/26 --> I downloaded the .jar and linked it via
-l/pathto/tensorflow_framework.so
, still thefatal error: tensorflow/core/framework/op_kernel.h: No such file or directory
is not found. - https://github.com/tensorflow/tensorflow/issues/1270 last comment does not work and so does not help me.
I tried to search for sudo find /usr/. -name "tensorflow_framework.so"
recursively but I could not find anything. Tensorflow is installed for sure via anaconda and I also cloned and compiled the repository from source.
How to find a way to include the -ltensorflow_framework
?
Solution
One answer, I have found:
I have installed my python via anaconda2 and I always tried to find out TF_INC and TF_LIB when I activated my repository source activate <env>
. and the could not found any ~/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow
*.so files
This time I went out every python environment with the shell command source deactivate
and I typed the following command
python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())'
Now, I got a different path: ~/anaconda2/lib/python2.7/site-packages/tensorflow
, where the lib libtensorflow_framework.so
is located.
Answered By - j35t3r Answer Checked By - Gilberto Lyons (WPSolving Admin)