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

gefragt vor 4 Jahren443 Aufrufe
4 Antworten
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.

beantwortet vor 4 Jahren
0

rekoguser

Yes that is the right approach.

AWS
beantwortet vor 4 Jahren
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
beantwortet vor 4 Jahren
0

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

beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen