如何在 sagemaker 中创建无服务器端点?

how to create a serverless endpoint in sagemaker?

我按照 aws 文档 (https://docs.aws.amazon.com/sagemaker/latest/dg/serverless-endpoints-create.html#serverless-endpoints-create-config) 创建模型并使用该模型,我为无服务器端点配置编码(下面的示例代码),我拥有所有必需的值,但这会抛出一个以下错误,我不确定为什么

参数验证失败未知参数 inProductVariants [0]:“ServerlessConfig”,必须是以下之一:VairantName、ModelName、InitialInstanceCount、Instancetype...

response = client.create_endpoint_config(
   EndpointConfigName="abc",
   ProductionVariants=[
        {
            "ModelName": "foo",
            "VariantName": "variant-1",
            "ServerlessConfig": {
                "MemorySizeInMB": 1024,
                "MaxConcurrency": 2
            }
        } 
    ]
)

您可能正在使用 旧的 bo​​to3 版本。 ServerlessConfig 是一个非常新的配置选项。如果可能,您需要升级到最新版本(1.21.1)。