如何使用SageMaker创建多模型终端节点?

0

【以下的问题经过翻译处理】 这是我的代码。

from datetime import datetime
from sagemaker.multidatamodel import MultiDataModel
mme = MultiDataModel(
    name="LV-multi-" + datetime.now().strftime("%Y-%m-%d-%H-%M-%S"),
    model_data_prefix=model_dir, # 2에서 구한 모델이 모여있는 폴더(경로)!!,
    model=sagemaker_model,  # 모델 객체 1개 우선 넣기
    sagemaker_session=sess
)

predictor = mme.deploy(
    initial_instance_count=1,
    instance_type="ml.g4dn.xlarge"
)

出现了错误信息。 我该如何找到包含multi-models=true的Ecr镜像?

ClientError: An error occurred (ValidationException) when calling the CreateModel operation: Your Ecr Image 763104351884.dkr.ecr.ap-northeast-2.amazonaws.com/pytorch-inference:1.8.1-gpu-py3 does not contain required com.amazonaws.sagemaker.capabilities.multi-models=true Docker label(s).

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

【以下的回答经过翻译处理】 目前,所有 CPU 实例类型和单 GPU 实例类型都支持多模型终端节点。,请参见此处:https://docs.aws.amazon.com/sagemaker/latest/dg/multi-model-endpoints.html#multi-model-endpoint-instance

为了托管多模型端点,请选择支持的实例类型。ECR映像将包含所需的'com.amazonaws.sagemaker.capabilities.multi-models=true'标签,请参见此处:https://github.com/aws/deep-learning-containers/blob/master/pytorch/inference/docker/1.8/py3/Dockerfile.cpu

profile picture
专家
已回答 8 个月前

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

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

回答问题的准则