question

SamC-3500 avatar image
0 Votes"
SamC-3500 asked SamC-3500 commented

Specified model not found or not ready, Model Id:

I was trying to use the Python SDK on my already trained custom model to analyze a form. My model's ID is 1098. However, I got this error:

 azure.core.exceptions.HttpResponseError: (1001) Specified model not found or not ready, Model Id: 1098
 Code: 1001
 Message: Specified model not found or not ready, Model Id: 1098

Here is my Python code:

 file = open("test.png", "rb")
 form_recognizer_client = FormRecognizerClient(endpoint, AzureKeyCredential(key))
 # get result
 poller = form_recognizer_client.begin_recognize_custom_forms(model_id="1098", form=file)
 result = poller.result()

I double checked my model finished training (yesterday), and I can use the FormRecognizerStudio to do this perfectly fine. But not the Python SDK due to this error. Could somebody help? Thanks.

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.

@SamC-2937 As the document, the model ID does not look like as your format, could you please check the training output?

Output should look like as this: https://docs.microsoft.coModel ID: ae636292-0b14-4e26-81a7-a0bfcbaf7c91

 Status: ready
 Training started on: 2020-08-20 23:20:56+00:00
 Training completed on: 2020-08-20 23:20:57+00:00
    
 Recognized fields:
 The submodel with form type 'form-ae636292-0b14-4e26-81a7-a0bfcbaf7c91' has recognized the following fields: CompanyAddress, CompanyName, CompanyPhoneNumber, DatedAs, Email, Merchant, PhoneNumber, PurchaseOrderNumber, Quantity, Signature, Subtotal, Tax, Total, VendorName, Website
 Document name: Form_1.jpg
 Document status: succeeded
 Document page count: 1
 Document errors: []
 Document name: Form_2.jpg
 Document status: succeeded
 Document page count: 1
 Document errors: []
 Document name: Form_3.jpg
 Document status: succeeded
 Document page count: 1
 Document errors: []
 Document name: Form_4.jpg
 Document status: succeeded
 Document page count: 1
 Document errors: []
 Document name: Form_5.jpg
 Document status: succeeded
 Document page count: 1m/en-us/azure/applied-ai-services/form-recognizer/how-to-guides/try-sdk-rest-api?pivots=programming-language-python#output-3

Could you please share the output to us?

In case you need the guidance of how to train model: https://docs.microsoft.com/en-us/azure/applied-ai-services/form-recognizer/how-to-guides/try-sdk-rest-api?pivots=programming-language-python#train-a-model-with-labels

0 Votes 0 ·

I have already trained this model using the FormRecognizer Studio website a few days ago. 1098 is the only model ID I can find, as per this screenshot. 198017-image.png

I also tried this code:

 # Next, we get a paged list of all of our custom models
 custom_models = form_training_client.list_custom_models()
 print("We have models with the following ids:")
 # Let's pull out the first model
 first_model = next(custom_models)
 print(first_model.model_id)
 for model in custom_models:
     print(model.model_id)

However, it gave me an error:
198048-image.png

Is there any other way to get the model ID? Or make the "not found or not ready" error disappear?

Other posts suggest that it results from using the wrong Python SDK version. However, the documentation is unclear about which version I need to use to interact with models trained using the website FormRecognizer Studio.



0 Votes 0 ·
image.png (5.0 KiB)

1 Answer

Yamakoto-0108 avatar image
0 Votes"
Yamakoto-0108 answered SamC-3500 commented

The model ID should be found from the portal / studio, any ways to list all the models and any roadmap to that ?

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

As per my previous comment, I added a picture listing my models, including my Model ID 1098 in the studio. However, when using the Python SDK, it is not able to find it. How do I get the Python SDK to find my already-trained model?

0 Votes 0 ·