Open colbec opened 7 years ago
I've just met this problem, too. There is one temporary solution: copy the libtensorflow_framework.so
from your python site-packages directory (e.g. /usr/lib/python3.6/site-packages/tensorflow/
) to the ~/.julia/v0.6/TensorFlow/deps/usr/bin/
solves the problem.
So it does see your libtensorflow.so
, but if that library in turn has a relative path to another dependent library, that will trigger that error. It used to be the case that libtensorflow.so
was self-contained, so if that's no longer the case, the instructions will have to be updated.
A more robust way then copying files is to just set the LIBTENSORFLOW environment variable to point to your libtensorflow.so. I should update the instructions to mention that.
OK thanks @haldai for this suggestion which gets my TF working again.
@malmaud I did actually try that suggestion just now of the ENV["LIBTENSORFLOW"]
pointing directly at the bazel-bin/tensorflow
output but for some reason it did not like that either.
Can you post the error? I'd like to get that working. On Sat, Oct 21, 2017 at 12:45 PM Colin Beckingham notifications@github.com wrote:
OK thanks @haldai https://github.com/haldai for this suggestion which gets my TF working again.
@malmaud https://github.com/malmaud I did actually try that suggestion just now of the ENV["LIBTENSORFLOW"] pointing directly at the bazel-bin/tensorflow output but for some reason it did not like that either.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/malmaud/TensorFlow.jl/issues/340#issuecomment-338415752, or mute the thread https://github.com/notifications/unsubscribe-auth/AA8Svb9X-8xreSziHVt1NpT1SNp3NaX3ks5suh-YgaJpZM4QBiMN .
Here is straight TF with both libtensorflow.so
and libtensorflow_framework.so
in deps/usr/bin
:
julia> Pkg.test("TensorFlow")
INFO: Testing TensorFlow
INFO: Checkpoint files saved in /tmp/tmpZdnOW6
Current loss is 230.42.
Current loss is 228.94.
Current loss is 227.46.
Current loss is 226.00.
... lots more, but clearly working.
Here is the ENV route:
julia> ENV["LIBTENSORFLOW"]="/home/colin/Downloads/tensorflow/bazel-bin/tensorflow/"
"/home/colin/Downloads/tensorflow/bazel-bin/tensorflow/"
julia> using TensorFlow
julia> Pkg.test("TensorFlow")
INFO: Testing TensorFlow
ERROR: LoadError: LoadError: could not load library "/home/colin/Downloads/tensorflow/bazel-bin/tensorflow/"
/home/colin/Downloads/tensorflow/bazel-bin/tensorflow/.so: cannot open shared object file: No such file or directory
Stacktrace:
and the rest as in the original post. If you need anything else let me know.
A small perhaps related issue is that once an ENV["LIBTENSORFLOW"]
setting is in effect, it seems hard to reset it. For example if I am running correctly with a libtensorflow
and _framework
.so files loaded, then try to set ENV["LIBTENSORFLOW"]
to a different string, find that testing TF fails, and then try to reset Julia back to the original setup, setting the ENV["LIBTENSORFLOW"]
to an empty string or nothing
does not restore the original default setup. We have to restart Julia - not a hardship, just something to be aware of.
@colbec
I've just met the same problem. I fixed it by setting the environment variable LIBTENSORFLOW
.
The environment variable LIBTENSORFLOW
should set to be the absolute path to the .so
file,
not the directory contains libtensorflow.so
.
In your case, it should be
julia> ENV["LIBTENSORFLOW"]="/home/colin/Downloads/tensorflow/bazel-bin/tensorflow/"
"/home/colin/Downloads/tensorflow/bazel-bin/tensorflow/libtensorflow.so"
You can set this variable in one of the .bash_profile
, .bashrc
, or .profile
files.
see http://malmaud.github.io/TensorFlow.jl/latest/build_from_source.html#Step-2:-Install-the-TensorFlow-binary-1 for detail.
In an effort to eliminate warnings about different versions of tensorflow in Python and Julia I updated my Python3 tensorflow to the latest nightly and it reports TF version 1.5. I then rebuilt latest TF source using bazel to profit from local MKL resources and bazel built the libtensorflow.so. I then dropped this new .so into the TensorFlow/deps/usr/bin per the instructions. The result is now:
The files: