You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过CloudFormation创建SageMaker无服务器端点?配置报错求助

解决SageMaker无服务器推理CloudFormation模板报错问题

错误原因

你遇到的Property validation failure报错,根源是两个配置错误:

  1. ServerlessConfig格式错误:它是对象类型,而非数组,你用了数组写法(加了-),导致CloudFormation无法识别。
  2. 缺少必填参数:ServerlessConfig必须包含MemorySizeInMB(内存大小,单位MB,可选值为1024、2048、3072、4096、5120、6144),你只配置了MaxConcurrency。

修正后的CloudFormation模板

SageMakerModel:
    Type: AWS::SageMaker::Model
    Properties: 
      Containers: 
        -
          Image: !Ref ImageURI
          ModelDataUrl: !Ref ModelData
          Environment: {"SAGEMAKER_PROGRAM": "inference.py", "SAGEMAKER_SUBMIT_DIRECTORY": !Ref ModelData}
      ExecutionRoleArn: !Ref RoleArn

SageMakerEndpointConfig:
    Type: "AWS::SageMaker::EndpointConfig"
    Properties:
      ServerlessConfig: 
        MaxConcurrency: 5
        MemorySizeInMB: 2048  # 必填参数,选择匹配你模型需求的内存值

额外注意事项

  • 确保你的SageMaker执行角色(RoleArn)拥有足够权限,比如SageMakerFullAccess或精细权限,允许创建无服务器端点配置。
  • 确认你的推理镜像支持SageMaker无服务器推理,所选内存大小需匹配模型资源需求,且在官方指定的可选范围内。

内容的提问来源于stack exchange,提问作者arve

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 19:10:51