OCR is failing in .NET 4.8 Framework and NET 2.0 Core projects

Dear Aspose Technical Support Team,
Urgent Assistance Required: Memory Allocation Error with Aspose.OCR

I am currently encountering a critical issue with the Aspose.OCR library while processing both TIF and PDF files. During the OCR process, I consistently receive memory allocation errors, which result in the application throwing a System.Exception.

    private static void OCRPdf()
    {
        AsposeOcr ocrEngine = new AsposeOcr();
        OcrInput ocrInput = new OcrInput(InputType.PDF)
        {
            "101_input.pdf"
        };
        List<RecognitionResult> recognitionResult = ocrEngine.Recognize(ocrInput);
        AsposeOcr.SaveMultipageDocument("101_output_from_PDF.pdf", SaveFormat.Pdf, recognitionResult);
    }

    private static void OCRTif()
    {
        AsposeOcr ocrEngine = new AsposeOcr();
        RecognitionSettings recognitionSettings = new RecognitionSettings
        {
            Language = Language.Eng,
            DetectAreasMode = DetectAreasMode.PHOTO,
            ThreadsCount = 1
        };
        OcrInput ocrInput = new OcrInput(InputType.TIFF)
        {
            "101_input.tif"
        };
        List<RecognitionResult> recognitionResult = ocrEngine.Recognize(ocrInput, recognitionSettings);
        AsposeOcr.SaveMultipageDocument("101_output_from_TIF.pdf", SaveFormat.Pdf, recognitionResult);
    }

Error Details: While running the OCR process, the following errors are logged:
Console:
2024-06-04 15:37:54.6107373 [E:onnxruntime:, sequential_executor.cc:514 onnxruntime::ExecuteKernel] Non-zero status code returned while running Mul node. Name:‘Conv_156_quant_output_scale_mul’ Status Message: bad allocation
2024-06-04 15:37:54.6271562 [E:onnxruntime:, sequential_executor.cc:514 onnxruntime::ExecuteKernel] Non-zero status code returned while running Mul node. Name:‘Conv_143_quant_output_scale_mul’ Status Message: bad allocation
2024-06-04 15:37:55.2687193 [E:onnxruntime:, sequential_executor.cc:514 onnxruntime::ExecuteKernel] Non-zero status code returned while running ConvInteger node. Name:‘Conv_156_quant’ Status Message: bad allocation
2024-06-04 15:37:55.9595350 [E:onnxruntime:, sequential_executor.cc:514 onnxruntime::ExecuteKernel] Non-zero status code returned while running Mul node. Name:‘Conv_159_quant_output_scale_mul’ Status Message: bad allocation
2024-06-04 15:38:06.4684882 [E:onnxruntime:, sequential_executor.cc:514 onnxruntime::ExecuteKernel] Non-zero status code returned while running ConvInteger node. Name:‘Conv_656_quant’ Status Message: bad allocation
2024-06-04 15:38:06.8894484 [E:onnxruntime:, sequential_executor.cc:514 onnxruntime::ExecuteKernel] Non-zero status code returned while running ConvInteger node. Name:‘Conv_656_quant’ Status Message: bad allocation

Following these errors, the application throws an exception with the message: “Exception of type ‘System.Exception’ was thrown.”

Environment:

  • Aspose.OCR Version: 24.5.0.0
  • Operating System: Windows 11 22H2
  • System RAM: 32GB
  • File sizes being processed: 6MB TIF and 16 MB PDF

Given the recurring nature of these errors and their impact on our operations, your assistance in resolving this issue would be greatly appreciated. Could you please provide guidance on how to address these memory allocation errors, or if there are any specific configurations or updates I should apply?

Thank you for your assistance.

101_input.pdf (6.0 MB)

@sergeykrasnov

We need to investigate the nature of this issue and further analyze it. Therefore, we have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): OCRNET-853

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi Asad,

We are part of the paid support team. How do we escalate this ticket to Paid Support? We have all the information.

Thank you!

@sergeykrasnov

You can simply create a topic/post in paid support forum while mentioning the ticket ID attached here and your issue will be escalated accordingly.