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.