通过 Lambda 触发 AWS Rekognition 自定义标签

问题描述

我的 s3 存储桶和 AWS Rekognition 模型都在 us-east-1 中。我也在 us-east-1 中的 lambda 是由上传到我的 s3 存储桶触发的。我粘贴了模型中自动生成代码(用于 python)并在我的 lambda 函数中使用它。我什至尝试授予对我的 s3 存储桶的完全访问权限(允许具有完全权限的公共访问)但是当我触发 lambda 时,我得到了这个异常

[ERROR] InvalidS3ObjectException: An error occurred (InvalidS3ObjectException) when calling the DetectCustomLabels operation: Unable to get object Metadata from S3. Check object key,region and/or access permissions.
Traceback (most recent call last):
  File "/var/task/lambda_function.py",line 80,in lambda_handler
    label_count=show_custom_labels(model,bucket,photo,min_confidence)
  File "/var/task/lambda_function.py",line 59,in show_custom_labels
    response = client.detect_custom_labels(Image={'S3Object': {'Bucket': bucket,'Name': photo}},File "/var/runtime/botocore/client.py",line 357,in _api_call
    return self._make_api_call(operation_name,kwargs)
  File "/var/runtime/botocore/client.py",line 676,in _make_api_call
    raise error_class(parsed_response,operation_name)

我正在打印我的存储桶名称和日志中的密钥,它们很好。我的密钥包含一个文件夹路径(folder1/folder2/image.jpg)。

我怎样才能克服这个错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)