TensorFlow.NET icon indicating copy to clipboard operation
TensorFlow.NET copied to clipboard

TensorFlow.NET on Raspberry Pi.

Open ucyildirim opened this issue 4 years ago • 5 comments

Hello there.

I am trying to run a test code SciSharp-HelloWorld-Samplpe on Raspberry Pi 4, 8GB.

No matter what i do, i get this error. Is there any way to make it work on Raspberry?

Unhandled exception. System.TypeInitializationException: The type initializer for 'Tensorflow.Binding' threw an exception.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.DllNotFoundException: Unable to load shared library 'tensorflow' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libtensorflow: cannot open shared object file: No such file or directory
   at Tensorflow.c_api.TF_NewStatus()
   at Tensorflow.Status..ctor()
   at Tensorflow.tensorflow..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
   at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
   at System.Activator.CreateInstance[T]()
   at Tensorflow.Binding.New[T]()
   at Tensorflow.Binding..cctor()
   --- End of inner exception stack trace ---
   at Tensorflow.Binding.get_tf()
   at TofasCoreTest.Program.Main(String[] args) in /home/pv2/Program.cs:line 24
Aborted (core dumped)

ucyildirim avatar Aug 18 '20 09:08 ucyildirim

Have the exact same problem. Could it be because there is no ARM version of the library? Any help shall be appreciated.

hbraasch avatar Aug 31 '20 07:08 hbraasch

Have you tried to install libtensorflowlite.so?

Oceania2018 avatar Aug 31 '20 08:08 Oceania2018

@Oceania2018, thanks for the suggestion.

It appears as if libtensorflowlite.so is for Android and does not support netcoreapp3.1. I am looking for a TensorFlow.Net library that runs on Raspian, compiled for ARM netcoreapp3.1. Maybe I'm missing something, can you please enlighten me?

hbraasch avatar Aug 31 '20 23:08 hbraasch

What I really mean is I'm looking for a "tensorflow.dll" compiled for Raspian/ARM so that the dependency problem when running TensorFlow.NET gets resolved.

hbraasch avatar Sep 06 '20 00:09 hbraasch

I've already have a "guide" here #703, you can check it out

minhduc66532 avatar Jan 08 '21 00:01 minhduc66532