Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails to copy all required linux shared objects for TensorFlow version 1.15. #476

Open
craigwalton opened this issue Feb 3, 2020 · 3 comments

Comments

@craigwalton
Copy link

Describe the bug
Build fails to copy all required linux shared objects for TensorFlow version 1.15, TensorFlowSharp version 1.15.1.

To Reproduce
Run using TensorFlowSharp 1.15.1 NuGet packages on linux.

Expected behavior
Required dependencies to be available.

Exception
Unhandled Exception: System.DllNotFoundException: Unable to load shared library 'libtensorflow' or one of its dependencies.

Desktop (please complete the following information):
Debian GNU/Linux 9 (stretch) within Docker container.

Additional context
Only libtensorflow.so and libtensorflow_framework.so are copied from libtensorflow\lib to runtimes\linux\native\ as part of the build specified in TensorFlowSharp.csproj. The following additional libraries from libtensorflow are also required for running TensorFlow 1.15 on linux:

libtensorflow.so.1
libtensorflow.so.1.15.0
libtensorflow_framework.so.1
libtensorflow_framework.so.1.15.0

I suspect the same issue exists for the .dylib files required by OS X, though have not tested this myself.

I propose replacing the following lines in TensorFlowSharp.csproj:

<None Include="..\native\libtensorflow.so" Link="nuget\runtimes\linux\native\libtensorflow.so" PackagePath="runtimes\linux\native\libtensorflow.so" Pack="true" />
<None Include="..\native\libtensorflow_framework.so" Link="nuget\runtimes\linux\native\libtensorflow_framework.so" PackagePath="runtimes\linux\native\libtensorflow_framework.so" Pack="true" />

With the following:

<None Include="..\native\libtensorflow*.so*">
  <Link>nuget\runtimes\linux\native\%(Filename)%(Extension)</Link>
  <PackagePath>runtimes\linux\native\%(Filename)%(Extension)</PackagePath>
  <Pack>True</Pack>
</None>

Libtensorflow binaries
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-1.15.0.tar.gz
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-1.15.0.zip

Please let me know if you'd like me to create a pull request to resolve this issue.

@nateagr
Copy link

nateagr commented Mar 17, 2020

Hi @craigwalton,

I'm facing the same issue as you. In the meantime, I've created my own NuGet which is working. But it is not productized. It seems this project is not maintained anymore. How did you overcome the issue on your side ? Did you fork the project ? Did you create a new NuGet as well ? If yes, did you publish it in public repo ?

Thanks.

@craigwalton
Copy link
Author

Hi @nateagr,

I am using TensorFlowSharp within a Docker container. So I added a RUN instruction to the Dockerfile which downloads (https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz) and unpacks the missing libraries into the required directory. I did not fork the project or publish anything on NuGet.

Sorry - this probably is not much help to you.

@nateagr
Copy link

nateagr commented Mar 17, 2020

Thanks for your answer 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants