[MMS预测中出现的问题] 在MMS(Sagemaker)中,错误码为(500),类型为InternalServerException。

0

【以下的问题经过翻译处理】 我使用SageMaker和MMS制作了PyTorch模型。这是我的MMS代码。

%%时间 instance_type = 'c5.large'

accelerator_type = 'eia2.medium'

predictor = mme.deploy( initial_instance_count=1, instance_type=f"ml.{instance_type}" )

mme.add_model(model_data_source=model_path, model_data_path="model.tar.gz") list(mme.list_models()) #> ['model.tar.gz']

我试图使用这段代码进行预测。

start_time = time.time() predicted_value = predictor.predict(requests, target_model="LV1") duration = time.time() - start_time print("${:,.2f}, took {:,d} ms\n".format(predicted_value[0], int(duration * 1000)))

但是,返回了错误消息。

ModelError: 调用InvokeEndpoint操作时发生错误 (ModelError):从带有消息的模型接收到服务器错误 (500):"{
  "code": 500,
  "type": "InternalServerException",
  "message": "Failed to start workers"
}

使用PyTorch和MMS是有些困难的。 X)

请帮帮我。

profile picture
专家
已提问 8 个月前16 查看次数
1 回答
0

【以下的回答经过翻译处理】 你好, 我认为你在预测时的目标模型需要与你部署的模型相同的名字-例如,当你添加模型时 mme.add_model(model_data_source=model_path, model_data_path="model.tar.gz") 其中model_data_path包含模型的名称。来自Sagemaker示例: (https://github.com/aws/amazon-sagemaker-examples/blob/main/advanced_functionality/multi_model_xgboost_home_value/xgboost_multi_model_endpoint_home_value.ipynb) model_data_path是我们上面指定的S3前缀(即model_data_prefix)的相对路径,我们的端点将从中获取用于推理请求的模型。由于这是相对路径,我们只需在推理时传递我们希望称呼模型工件的名称(即Chicago_IL.tar.gz)。在你的情况下是“model.tar.gz”。 然而,当你预测时你调用的目标模型是"LV1"吗?

profile picture
专家
已回答 8 个月前

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

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

回答问题的准则