Need help with " Member must satisfy regular expression pattern" error

1

Hello all,

I'm trying to detect custom labels and have gone through all the steps in the guide including training, labeling, starting the project etc. The problem I'm having is when I try to actually detect custom labels from AWS CLI, the following error message is encountered:

An error occurred (ValidationException) when calling the DetectCustomLabels operation: 1 validation error detected: Value 'arn:aws:s3:::<my bucket ARN>' at 'image.s3Object.bucket' failed to satisfy constraint: Member must satisfy regular expression pattern: [0-9A-Za-z\.\-_]*

According to the docs link:https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/detecting-custom-labels.html#w1141aac36c23c10b2b1, here is the command.

aws rekognition detect-custom-labels --project-version-arn "model_arn"\
   --image '{"S3Object":{"Bucket":"bucket","Name":"image"}}'\
   --min-confidence 70

Accordingly:

"model_arn": copy-pasted from my model info page
"bucket": copy-pasted the full S3 ARN from my S3 bucket
"image": copy-pasted the full path of the image to analyze in the same S3 bucket

Would appreciate any suggestions into how to resolve this. Thanks.

질문됨 4년 전21191회 조회
2개 답변
0

Posting the solution to help someone else (or most likely myself since I'm probably going to forget about this and face this problem again some day).

"bucket": NOT the ARN but the simple bucket name.
"image": the path to the S3 Object but excluding the bucket. Thus if the image file is in "assets" sub-folder, "dataset_1" sub-folder, "1278368" sub-folder, then the field should be "assets/dataset_1/1278368/my_image.jpg". NB: there is no leading slash before "assets".

답변함 4년 전
0

I experience slightly different but mainly same error:

botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the DescribeStacks operation: 1 validation error detected: Value 'sam_standalone_a_stack-38b43029-CompanionStack' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*|arn:[-a-zA-Z0-9:/._+]*

My case was due to '_' (expression not accept _ only -)

Be careful.

Oliver
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠