Azure form Recognizer - The Form Recognizer API version used to create the model and the current API version used for analyze are incompatible

Mike Wong 1 Reputation point
2021-05-10T16:10:51.717+00:00

Hello,

I've been using the Azure Form Recognizer service and created a few supervised learning models on https://fott-preview.azurewebsites.net/.

I'm currently at the stage where I want to use this model via Python in order to extract tabular and text data from PDFs into either a JSON or CSV. However, when I run the code in Python for the form recognizer

endpoint = "<my_endpoint>"
key = "<my_key>"

form_recognizer_client = FormRecognizerClient(endpoint, AzureKeyCredential(key))

model_id = "<my_model_id>"
form = r"<C:\path\to\my_form>"

with open(form, "rb") as rb_form:
    poller = form_recognizer_client.begin_recognize_custom_forms(
        model_id=model_id, form=rb_form, content_type="application/pdf"
    )

This doesn't work and I get:

azure.core.exceptions.HttpResponseError: (1027) The Form Recognizer API version used to create the model and the current API version used for analyze are incompatible.

Here's what I've tried:

  • Specifying the api_version in the begin_recognize_custom_forms method. I've tried both of them available 2.1-preview.3 and 2.0 and neither work so this means my model was trained in neither of these version despite it clearly saying the API version is 2.1 in the website above.
  • Tried deleting all of the labels and reassigning them. This didn't change anything.
  • Refreshed the key. This didn't change anything.

Has anybody solved this problem or got any ideas? Thank you.

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,396 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. YutongTie-MSFT 46,986 Reputation points
    2021-05-10T18:33:26.157+00:00

    Hello,

    If the model is trained with a different version from the one used for analyze API this message would be seen. You can use the same version of analyze API to ensure the response is successful. Could you please check?

    Regards,
    Yutong


  2. Bhavya Parikh 21 Reputation points
    2021-09-20T11:06:57.987+00:00

    how to find which version i am using for azure form recognize is there any way i can get details from portal?

    0 comments No comments