(ResourceNotReadyException):Error when calling DetectCustomLabels operation

0

After successfully creating a custom label model on the console, I am trying to use the model for prediction as follows:

from boto3 import client
rekog = client('rekognition')
response = rekog.detect_custom_labels(Image={'S3Object':{'Bucket':bucket, 'Name':key}}, ProjectVersionArn=project_version_arn)

But I am getting the following Exception error: <br><br>
An error occurred (ResourceNotReadyException) when calling the DetectCustomLabels operation: ProjectVersion arn:aws:rekognition:
us-east-1:blah-blab-blal------ is not ready

I thought the ProjectVersion should be ready once the the model is created with a defined and available project_version_arn.

It is more than one day now and it still saying not ready.

Is there anything I have to do to make the model (project_version_arn) ready?

已提问 4 年前443 查看次数
4 回答
0

I found solution to this problem. I just discovered that I commented out the following line in my code:

start_project = rekog.start_project_version(ProjectVersionArn=project_version_arn, MinInferenceUnits=1)

I uncommented it and it is working.

The line above needs to be called after the training and it should be ensured that the model Status has changed to RUNNING before calling the detect_custom_labels() method.

已回答 4 年前
0

rekoguser

Yes that is the right approach.

AWS
已回答 4 年前
0

Hello rekoguser

Also please note that your billing will start once the model is in the RUNNING state.

Once you are done, please use the StopProjectVersion API to bring the model to a STOPPED state.
https://docs.aws.amazon.com/rekognition/latest/dg/API_StopProjectVersion.html

This will also stop your billing for that project version.

You can find more billing details here - https://aws.amazon.com/rekognition/pricing/ (section "Amazon Rekognition Custom Labels pricing").

AWS
已回答 4 年前
0

Hi awsrakesh,
Yes. That is what I am doing already. Thanks for the reminder.

已回答 4 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则