Sagemaker 端点返回奇怪的错误

Sagemaker Endpoint returning strange error

大家好,最近我开始与 sagemaker 合作,我正在测试自动驾驶仪,它获得了相当不错的准确性,我想在更多数据上对其进行测试,所以我选择了具有最佳 ACC 的那个并创建了一个端点。现在的问题是我不知道如何正确使用端点。我尝试使用 AWS CLI,但我不断收到以下错误:

命令:

aws sagemaker-runtime invoke-endpoint --endpoint-name autopilottest --body 'SW0gaGFwcHk=' f

错误信息:

An error occurred (ModelError) when calling the InvokeEndpoint operation: Received client error (415) from container-1 with message "'application/json' is an unsupported content type.". See https://eu-west-2.console.aws.amazon.com/cloudwatch/home?region=eu-west-2#logEventViewer:group=/aws/sagemaker/Endpoints/autopilottest in account 288240193481 for more information.

命令:

aws sagemaker-runtime invoke-endpoint --endpoint-name autopilottest --body 'Im happy!' f

错误信息:

Invalid base64: "Im happy!"

端点配置:

通过添加 --content-type text/csv 并使用 base64 最终解决了这个问题,效果非常好。