question

RatanKumarPrajapati-4909 avatar image
0 Votes"
RatanKumarPrajapati-4909 asked SergM-7274 commented

EntryPointNotFoundException: Unable to find an entry point named 'OrtGetApiBase' in DLL 'onnxruntime'.

I want to make prediction using azure AutoML onnx model in .net core(3.1) console application in visual studio. I have exported onnx model from azure AutoML.

I am following the tutorial link : https://docs.microsoft.com/en-us/azure/machine-learning/how-to-use-automl-onnx-model-dotnet

It says to install following packages (in parenthesis shows the version I am using)
Microsoft.ML (1.5.4)
Microsoft.ML.OnnxRuntime(1.7.0)
Microsoft.ML.OnnxTransformer(1.5.4)

while defining the pipeline
var onnxPredictionPipeline =mlContext.Transforms.ApplyOnnxModel(
outputColumnNames: outputColumns,
inputColumnNames: inputColumns,
ONNX_MODEL_PATH);

I am getting the following error :
System.TypeInitializationException: 'The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception.'
EntryPointNotFoundException: Unable to find an entry point named 'OrtGetApiBase' in DLL 'onnxruntime'.

Then I tried with Microsoft.ML.OnnxRuntime.Managed(1.7.1) along with above packages but still getting the same issue.

Please suggest to resolve this issue.






azure-machine-learning
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, can you try adding Microsoft.ML.OnnxRuntime.Gpu package to your solution?

0 Votes 0 ·

Hi,
Thanks for your reply.

I added Microsoft.ML.OnnxRuntime.Gpu in my solution, but still getting the same issue.

Regards,
Ratan Kumar

0 Votes 0 ·

Hi,

I had the same problem in loading of my model by:
var session = new InferenceSession(@"model.onnx");

It was fixed by recompilation of my project in x64..., because of ML .Net works only for in x64.

Best Regards,
Sergey

0 Votes 0 ·
rakibulIslam-9794 avatar image
1 Vote"
rakibulIslam-9794 answered TaoMei-6430 commented

In my environment I reproduce the issue after uninstall below redistributable package from control panel.

Microsoft Visual C++ 2015-2019 Redistributable (x64) -14.29....
Microsoft Visual C++ 2015-2019 Redistributable (x86) -14.29....

My OS is Windows 10, Visual Studio 2019

and installing again this package may solve the issue.

https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0
Direct Link:
https://aka.ms/vs/16/release/vc_redist.x86.exe
and
https://aka.ms/vs/16/release/vc_redist.x64.exe

please install those if not install. And try .
If doesn't work Then Install all C++ for Desktop from Visual Studio Installer.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am able to solve this issue after installing "Desktop development with C++" from VS installer!
Thanks!

0 Votes 0 ·
MattiaFabi-0181 avatar image
0 Votes"
MattiaFabi-0181 answered

Hi,
I included those packages but I am still getting the same error.
Has anyone else having the same error message and managed to fix it? I read someone else talking about cuda version non compatible, but I don't know what I should do to fix it... Any idea?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RatanKumarPrajapati-4909 avatar image
0 Votes"
RatanKumarPrajapati-4909 answered

Hi,
I included the following packages:

Microsoft.ML (1.5.5)
Microsoft.ML.OnnxRuntime.Managed(1.7.1)
Microsoft.ML.OnnxRuntime.MKLML(1.6.0)
Microsoft.ML.OnnxTransformer(1.5.5)

It is working now.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.