跳至内容

ModelError while using InvokeEndpoint with Sagemaker

0

I've deployed a pytorch model onto Sagemaker and have confirmed that the endpoint is in service, but using the invoke endpoint operation results in the following error: "ModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (500) from primary and could not load the entire response body." I've ensured that the tar.gz file contains the inference code, model, tokenizer, etc., and have tried simplifying the model script so it returns the bare minimum to make sure there are no problems with how data is being processed, but the error persists. If anyone has experienced this before or has any advice on what to try, I'd appreciate any help!

已提问 3 年前1837 查看次数
1 回答
0
已接受的回答

Hi Siddharth,

There's not a whole lot of information for us to go off from here. It's a general error, but I've faced it before when passing the inputs to the model incorrectly. What type of data are you trying pass through?

A suggestion is to try run Sagemaker in local mode. If you run locally, do you experience a similar error?

To help more, I'd need to see any further tracebacks, cloudwatch logs or more information on what you're trying to achieve.

Let me know how you get on.

Cheers James

已回答 3 年前
  • Hi James, I'm trying to pass in a json, and I've used json.dumps during my InvokeEndpoint calls as well as json.loads within the inference code when processing input data. I haven't tried local mode, but I'll certainly give it a try!

    I think it's worth noting that I haven't used a pytorch container, and instead have only defined dependencies that my code runs upon. Would this cause issues? If so, would it be possible to point me towards some sort of documentation on creating a dockerfile/image/pytorch container since I've been struggling to learn about it online. Thanks so much.

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

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