Aspose.OCR Error calling api.RecognizePDF

I am getting this error returned:
“vbCrLf & “[ErrorCode:RuntimeException] Non-zero status code returned while running ConvInteger node. Name:‘Conv_656_quant’ Status Message: bad allocation””

When I call:
Dim api As Aspose.OCR.AsposeOcr = New Aspose.OCR.AsposeOcr()
Dim res As List(Of Aspose.OCR.RecognitionResult) = api.RecognizePdf(pdfDir, New Aspose.OCR.DocumentRecognitionSettings With {
.StartPage = 0
})

Using a PDF I created with Aspose PDF api. See attached.BRZ0000001.PDF (412.0 KB)

@salemantulsa

We used below code snippet with Aspose.OCR for .NET 22.5 and were unable to notice any issue.

// C# Code
var api = new OCR.AsposeOcr();

var settings = new OCR.DocumentRecognitionSettings();
settings.StartPage = 0;
//settings.PagesNumber = 2;
//settings.LinesFiltration = true;
settings.DetectAreas = true;
settings.DetectAreasMode = OCR.DetectAreasMode.COMBINE;
settings.ThreadsCount = 1;

var res = api.RecognizePdf(dataDir + "BRZ0000001.pdf", settings);

OCR.AsposeOcr.SaveMultipageDocument(dataDir + "test2.pdf", OCR.SaveFormat.Pdf, res);

test2.pdf (65.2 KB)

An output PDF is also attached for your kind reference. Can you please make sure to use the latest version of the API and let us know in case you face any issues.

I am getting a “Microsoft.ML.OnnxRuntime.OnnxRuntimeException” error and then your api throw the exception: "vbCrLf & “[ErrorCode:RuntimeException] Non-zero status code returned while running ConvInteger node. Name:‘Conv_656_quant’ Status Message: bad allocation”

More error code info: “2022-06-28 12:56:33.0494013 [E:onnxruntime:, sequential_executor.cc:364 onnxruntime::SequentialExecutor::Execute] Non-zero status code returned while running ConvInteger node. Name:‘Conv_656_quant’ Status Message: bad allocation”

StackTrace: " at Microsoft.ML.OnnxRuntime.NativeApiStatus.VerifySuccess(IntPtr nativeStatus) in D:\a_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\NativeApiStatus.shared.cs:line 31" & vbCrLf & " at Microsoft.ML.OnnxRuntime.InferenceSession.RunImpl(RunOptions options, IntPtr[] inputNames, IntPtr[] inputValues, IntPtr[] outputNames, DisposableList1 cleanupList) in D:\a\_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.shared.cs:line 694" & vbCrLf & " at Microsoft.ML.OnnxRuntime.InferenceSession.Run(IReadOnlyCollection1 inputs, IReadOnlyCollection1 outputNames, RunOptions options) in D:\a\_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.shared.cs:line 226" & vbCrLf & " at Microsoft.ML.OnnxRuntime.InferenceSession.Run(IReadOnlyCollection1 inputs, IReadOnlyCollection1 outputNames) in D:\a\_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.shared.cs:line 208" & vbCrLf & " at Microsoft.ML.OnnxRuntime.InferenceSession.Run(IReadOnlyCollection1 inputs) in D:\a_
work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.shared.cs:line 197" & vbCrLf & " at " & ChrW(3) & " ." & ChrW(14) & "​ " & ChrW(2) & "(Byte[,][] " & ChrW(2) & ", Int32 " & ChrW(3) & “, Int32 " & ChrW(5) & “)” & vbCrLf & " at " & ChrW(2) & " .” & ChrW(14) & "​ " & ChrW(2) & "(Byte[,][] " & ChrW(2) & ", Int32 " & ChrW(3) & “, Int32 " & ChrW(5) & “)” & vbCrLf & " at " & ChrW(15) & " .” & ChrW(3) & “(RecognitionSettings " & ChrW(2) & “)” & vbCrLf & " at " & ChrW(15) & " .” & ChrW(2) & “(RecognitionSettings " & ChrW(2) & “)” & vbCrLf & " at " & ChrW(15) & " .” & ChrW(2) & “(” & ChrW(6) & " " & ChrW(2) & “, DocumentRecognitionSettings " & ChrW(3) & “)” & vbCrLf & " at Aspose.OCR.AsposeOcr.RecognizePdf(String fullPath, DocumentRecognitionSettings settings)”

@salemantulsa

Have you installed the API using NuGet Package Manager? Please note that Aspose.OCR for .NET has dependency upon OnnxRuntime Library. If you install it in VS Project using NuGet Package, all dependencies would be installed automatically. Please try to do a fresh installation by creating a sample console application and let us know in case you face any issues.