An error occurred (ModelError) when calling the InvokeEndpoint operation

0

Hello,
I received the following error message when I tried to send an array to my model:

An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (500) from container-1 with message "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<title>500 Internal Server Error</title> <h1>Internal Server Error</h1> <p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p> ". See https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logEventViewer:group

I have created inference pipeline containing preprocessing and autoencoder model and deployed it to a single endpoint. Am trying to send raw data in text/csv format. EX: "39, 4, 9, 8, contact"

Please help me out in this.

Much appreciated,
Karthik

已提问 3 年前13017 查看次数
1 回答
0

Hello,

So the issue here is most likely with your inference code and how you are parsing/transforming the data coming in. Your endpoint is up and running but the format in which you are feeding it data is confusing it. The endpoint is expecting encoded data thus you need to convert your payload into the appropriate data format, there are two manners in which you can approach this.

  1. Use a serializer, when creating your endpoint with the predictor class you want to use the SageMaker Serializer to automatically encode/decode your data, this is configured while creating your endpoint. Look at the following code snippet below.

from sagemaker.predictor import csv_serializer
rf_pred = rf.deploy(1, "ml.m4.xlarge", serializer=csv_serializer)

#for prediction, decode the data properly
print(rf_pred.predict(payload).decode('utf-8'))

  1. If you choose not to use the serializer you want to encode the data on your own using something such as json.dumps(payload) to encode your data properly before sending the data to the endpoint.

Extra Resources:
SageMaker Serializers: https://sagemaker.readthedocs.io/en/stable/api/inference/serializers.html

Hope this helps!

已回答 3 年前
profile picture
专家
已审核 1 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则