GlitchEnzo / NuGetForUnity

A NuGet Package Manager for Unity
MIT License
3.09k stars 309 forks source link

Error while running OnnxRuntime #420

Open pytholic opened 2 years ago

pytholic commented 2 years ago

Hi. Thank you for the package.

I am working with OnnxRuntime side Unity3D. I installed Microsoft.ML.Onnxruntime packages using NugetForUnity. However, at runtime I run into this exception:

EntryPointNotFoundException: OrtGetApiBase Microsoft.ML.OnnxRuntime.NativeMethods..cctor () (at <2b5de034e06549d8a90fddfdbe8a7978>:0) Rethrow as TypeInitializationException: The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception. Microsoft.ML.OnnxRuntime.SessionOptions..ctor () (at <2b5de034e06549d8a90fddfdbe8a7978>:0) Microsoft.ML.OnnxRuntime.InferenceSession..ctor (System.String modelPath) (at <2b5de034e06549d8a90fddfdbe8a7978>:0) TestScript.Start () (at Assets/Scenes/TestScript.cs:74)

The same script and setup works fine with my previous approaches in which I manually made Onnxruntime setup using .dll files and it worked fine with Unity scripts. Now I wanted to try NugetForUnity package manager for installation but I ran into this. Any guidance?

JoC0de commented 1 year ago

OnnxRuntime is a native package (it requires native e.g. C++ Dll's) witch is currently not supportet by NuGetForUnity. See fPR #421