(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?

asked 4 years ago438 views
4 Answers
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.

answered 4 years ago
0

rekoguser

Yes that is the right approach.

AWS
answered 4 years ago
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
answered 4 years ago
0

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

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions