emgucv / emgutf

Emgu TF is a cross platform .Net wrapper for the Google Tensorflow library. Allows Tensorflow functions to be called from .NET compatible languages such as C#, VB, VC++, IronPython.
https://www.emgu.com/wiki/index.php/Emgu_TF
Other
214 stars 43 forks source link

DllNotFoundException: tfliteextern in unity on MacOS #88

Closed mmf007 closed 10 months ago

mmf007 commented 1 year ago

Hello! When installing Emgu CV and Emgu TF Lite packages together in unity 2020.3.23 on MacOS. When running your example from Emgu.TF.Lite\Demo\MobilenetScene.unity an error occurs.

DllNotFoundException: tfliteextern assembly: type: member:(null) Emgu.TF.Lite.TfLiteInvoke..cctor () (at Assets/Emgu.TF.Lite/Assets/Scripts/Emgu.TF.Lite/TFLiteInvoke.cs:494) Rethrow as DllNotFoundException: Unable to load native binary. Please make sure a proper Emgu.TF.Lite.runtime.{platform} nuget package is added, or make sure the native binary can be found in the folder of the executable. Emgu.TF.Lite.TfLiteInvoke..cctor () (at Assets/Emgu.TF.Lite/Assets/Scripts/Emgu.TF.Lite/TFLiteInvoke.cs:502) Rethrow as TypeInitializationException: The type initializer for 'Emgu.TF.Lite.TfLiteInvoke' threw an exception. MobilenetBehavior+d__6.MoveNext () (at Assets/Emgu.TF.Lite/Demo/MobilenetBehavior.cs:34) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/Coroutines.cs:17)

Tried to put everything in a new project. Same error.

Help me please.

emgucv commented 1 year ago

Are you using unity 2020.3.23 with MacOS on apple silicon (arm64) or intel (x64)?

mmf007 commented 1 year ago

MacOS on intel (x64)

mmf007 commented 1 year ago

One Emgu TF Lite without Emgu CV works well.

emgucv commented 1 year ago

Just created a new Unity 3D project using Unity 2020.3.31f1. Imported Emgu CV 4.6.0.5131 & Emgu TF Lite 2.10.1.1493 from Unity Asset Store. Opened the demo scene under "Emgu.TF.Lite\Demo\MobileNetScene", run the scene and it is working as expected. Mac OS Ventura 13.4 on Intel x64 cpu: image

emgucv commented 10 months ago

Closing ticket now.