question

narendramuidili-3714 avatar image
2 Votes"
narendramuidili-3714 asked NgaManning-1860 commented

form recognizer: not all custom models are working

Hello All,

I have trained multiple custom models and using those custom model into the following piece of code.
Response<RecognizedFormCollection> forms = await client.StartRecognizeCustomFormsFromUri(modelId, invoiceUri).WaitForCompletionAsync();
the very first custom model I trained is still working fine. rest of the are not working. Here's the error I am getting.

An unhandled exception occurred while processing the request.
RequestFailedException: Generic error during prediction.
Status: 200 (OK)
ErrorCode: 3014

Additional Information:
error-0: 3014: Generic error during prediction.

Content:


Headers:
ms-azure-ai-errorcode: REDACTED
x-envoy-upstream-service-time: 27
apim-request-id: 476f6fbf-b833-413a-8b04-84c7959d1334
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
Date: Wed, 17 Mar 2021 02:05:37 GMT
Content-Length: 213
Content-Type: application/json; charset=utf-8




Azure.RequestFailedException: Generic error during prediction.
Status: 200 (OK)
ErrorCode: 3014

Additional Information:
error-0: 3014: Generic error during prediction.

Content:


Headers:
ms-azure-ai-errorcode: REDACTED
x-envoy-upstream-service-time: 27
apim-request-id: 476f6fbf-b833-413a-8b04-84c7959d1334
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
Date: Wed, 17 Mar 2021 02:05:37 GMT
Content-Length: 213
Content-Type: application/json; charset=utf-8

at Azure.AI.FormRecognizer.Models.RecognizeCustomFormsOperation.UpdateStatusAsync(Boolean async, CancellationToken cancellationToken)
at Azure.AI.FormRecognizer.Models.RecognizeCustomFormsOperation.UpdateStatusAsync(CancellationToken cancellationToken)
at Azure.Core.OperationHelpers.DefaultWaitForCompletionAsync[TResult](Operation`1 operation, TimeSpan pollingInterval, CancellationToken cancellationToken)
at Azure.AI.FormRecognizer.OperationExtensions.WaitForCompletionAsync(Task`1 operation, CancellationToken cancellationToken)
at OCR.Controllers.FormRecognizerController.Index(FormModel frmFile) in C:\Users\nmuidil\source\repos\OCR\OCR\Controllers\FormRecognizerController.cs:line 115
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g_Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g
Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g
Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g
Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g
Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g
Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g
_AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

azure-form-recognizer
· 2
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.

Even I am facing a similar issue can I know the solution, please? The below answer is not clear enough and I am using latest nuget package but still the same error.

More information on this issue can be found in the below link.
https://github.com/Azure/azure-sdk-for-net/issues/20081

0 Votes 0 ·

@narendramuidili-3714 - Response to the above question will be much appreciated.

0 Votes 0 ·
ramr-msft avatar image
0 Votes"
ramr-msft answered ramr-msft commented

@narendramuidili-3714 Thanks for the question. Model Compose in Form Recognizer that will address this. Custom model – Extract key value pairs trained on your own documents.

Support for Model Compose more are now available in Form Recognizer 2.1 Public Preview Release. Please follow the Model Compose that allows multiple models to be composed and called with a single model ID. When a document is submitted to be analyzed with a composed model ID, a classification step is first performed to route it to the correct custom model.


· 6
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 have multiple models, I composed all together into one and tried. Still I am getting same Exception.

0 Votes 0 ·

Very first trained custom model still working fine. after that I created multiple models. they all are working good in labeling tool under predict section.

0 Votes 0 ·

@ramr-msft thanks for the response on my issue. As you said I composed all models into a new model and used the model. Response didn’t change and the later deleted all the models and trained a brand new custom model and tried to make it work. Response is still error during prediction with error code:3014.

0 Votes 0 ·

@narendramuidili-3714 Thanks for the details. Can you please confirm did you include inbuilt models?

0 Votes 0 ·


@ramr-msft thanks for responding. No, I don’t not include the prebuilt models. I composed all custom models into 1. Later I figured some how my code is pointing to form recognizer V2.0 and my models are in V2.1. In the Form recognizer quick start documentation , I saw Azure.AI.FormRecognizer --version 3.1.0-beta.1 nuget package should target to 2.1. But it’s not, that is causing this issue.

1 Vote 1 ·
ramr-msft avatar image ramr-msft narendramuidili-3714 ·

@narendramuidili-3714 Thanks for the update.

0 Votes 0 ·
Danicode-3378 avatar image
1 Vote"
Danicode-3378 answered NgaManning-1860 commented

I had the same problem. I had to update the nuget package from 3.1.0-beta.1 to 3.1.0-beta.4 and then it worked.

Hope this helps someone!

· 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.

Indeed this is the fix. I had the same problem and updating nuget package solved it. Thank you!!

0 Votes 0 ·