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년 전13014회 조회
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
전문가
검토됨 한 달 전

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

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

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

관련 콘텐츠