question

MikeWong-7256 avatar image
0 Votes"
MikeWong-7256 asked BhavyaParikh-2913 answered

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

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-form-recognizer
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.

YutongTie-MSFT avatar image
0 Votes"
YutongTie-MSFT answered

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

Hello Yutong,

Thank you for your reply.

It appears the analyzer I was using recorded the version as 2.1 yesterday. I woke up this morning and it is now 2.1-preview.3 so it looks like a problem which was resolved Microsoft side.

Thank you again!

0 Votes 0 ·

Sounds great, I will convert this to answer. Feel free to mark it as answer if you feel it's helpful ^^


Regards,
Yutong

0 Votes 0 ·
BhavyaParikh-2913 avatar image
0 Votes"
BhavyaParikh-2913 answered

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

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.