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

feita há 4 anos443 visualizações
4 Respostas
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.

respondido há 4 anos
0

rekoguser

Yes that is the right approach.

AWS
respondido há 4 anos
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
respondido há 4 anos
0

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

respondido há 4 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas