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

preguntada hace 4 años444 visualizaciones
4 Respuestas
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 hace 4 años
0

rekoguser

Yes that is the right approach.

AWS
respondido hace 4 años
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 hace 4 años
0

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

respondido hace 4 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas