我正在通过Sagemaker将模型部署到AWS上:
我将JSON模式设置如下:
import json
schema = {
"input": [
{
"name": "V1",
"type": "double"
},
{
"name": "V2",
"type": "double"
},
{
"name": "V3",
"type": "double"
},
{
"name": "V4",
"type": "double"
},
{
"name": "V5",
"type": "double"
},
{
"name": "V6",
"type": "double"
},
{
"name": "V7",
"type": "double"
},
{
"name": "V8",
"type": "double"
},
{
"name": "V9",
"type": "double"
},
{
"name": "V10",
"type": "double"
},
{
"name": "V11",
"type": "double"
},
{
"name": "V12",
"type": "double"
},
{
"name": "V13",
"type": "double"
},
{
"name": "V14",
"type": "double"
},
{
"name": "V15",
"type": "double"
},
{
"name": "V16",
"type": "double"
},
{
"name": "V17",
"type": "double"
},
{
"name": "V18",
"type": "double"
},
{
"name": "V19",
"type": "double"
},
{
"name": "V20",
"type": "double"
},
{
"name": "V21",
"type": "double"
},
{
"name": "V22",
"type": "double"
},
{
"name": "V23",
"type": "double"
},
{
"name": "V24",
"type": "double"
},
{
"name": "V25",
"type": "double"
},
{
"name": "V26",
"type": "double"
},
{
"name": "V27",
"type": "double"
},
{
"name": "V28",
"type": "double"
},
{
"name": "Amount",
"type": "double"
},
],
"output":
{
"name": "features",
"type": "double",
"struct": "vector"
}
}
schema_json = json.dumps(schema)
print(schema_json)
并部署为:
from sagemaker.model import Model
from sagemaker.pipeline import PipelineModel
from sagemaker.sparkml.model import SparkMLModel
sparkml_data = 's3://{}/{}/{}'.format(s3_model_bucket, s3_model_key_prefix, 'model.tar.gz')
# passing the schema defined above by using an environment variable that sagemaker-sparkml-serving understands
sparkml_model = SparkMLModel(model_data=sparkml_data, env={'SAGEMAKER_SPARKML_SCHEMA' : schema_json})
xgb_model = Model(model_data=xgb_model.model_data, image=training_image)
model_name = 'inference-pipeline-' + timestamp_prefix
sm_model = PipelineModel(name=model_name, role=role, models=[sparkml_model, xgb_model])
endpoint_name = 'inference-pipeline-ep-' + timestamp_prefix
sm_model.deploy(initial_instance_count=1, instance_type='ml.c4.xlarge', endpoint_name=endpoint_name)
我得到的错误如下:
ClientError:调用CreateModel操作时发生错误(ValidationException):检测到1个验证错误:值“{SAGEMAKER_SPARKML_SCHEMA={”输入“:[{”类型“:“double”,“名称“:“V1”},{”类型“:“V2”},{”类型“:“V3”},{”类型“:“double”,“名称“:“V4”},{”类型“:“double”,“名称“:“V5”},{”类型“:”“double”,“name”:“V6”},{“type”:“double”,“name”:“V7”},{“type”:“double”,“name”:“V9”},{“type”:“double”,“name”:“V10”},{“type”:“double”,“name”:“V11”},{“type”:“double”,“name”:“V12”},{“type”:“double”,“name”:“V13”},{“type”:“double”,“name”:“V14”},{“type”:“double”,“name”:“name”:“V15”},{“type”:“type”:双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度,双精度double、name:“V26”}、{“type”:“double”、“name”:“V27”}、{“type”:“double”、“name”:“V28”}、{“type”:“double”、“name”:“Amount”}]、“output”:{“type”:“double”、“name”:“features”、“struct”:“vector”}}at“containers.1**.member.environment”未能满足约束:映射值必须满足约束:[成员的长度必须小于或等于1024,**成员的长度必须大于或等于0,成员必须满足正则表达式模式:[\S\S]*]
我尝试将我的功能减少到20个,并且它能够部署。只是想知道如何传递具有29个属性的模式?
我不认为1024限制的环境长度会在短时间内增加。为了解决这个问题,您可以尝试使用SAGEMAKER_SPARKML_SCHEMA
env var重建Spark ml容器:
https://github.com/aws/sagemaker-sparkml-serving-container/blob/master/README.md#running-the-image-locally
我正在使用Eclipse for Java和AWS工具包。我运行以下代码: 我在控制台视图中看到: […{Name:Name,AttributeDataType:String,DeveloperOnlyAttribute:false,Mutable:true,Required:false,StringAttributeConstraints:{MinLength:0,MaxLength:2048}
我正在尝试在AWS中应用身份池策略。我正在使用awc cli设置策略,但标题中经常出现以下例外情况: 调用AttachPrincipalPolicy操作时发生错误(InvalidRequestException):检测到1个验证错误:“policyName”处的值“DeviceShadowPolicy”未能满足约束:成员必须满足正则表达式模式:[\w=,。@-] 这是我使用的命令: 我不明白为什么
我正在创建一个AWS CodePipeline资源与terraform: 运行时,在它返回 编辑: 新的部署阶段是: 我有这个应用程序创建使用: 组使用:
我打算访问zip文件的s3存储桶。 当我使用下面的代码时,它可以访问存储桶,因为它使用存储桶的根目录。 “S3Bucket”:{“Ref”:“HandlerCodeS3Bucket”}, 当我想访问同一个bucket的layers文件夹时,我使用HandlerCodeS3BucketLayer参数。 但它显示以下错误。
我一直在AWS Mobile Hub上使用用户池。我已经设法与Facebook和G等提供商进行了登录。但是,当尝试使用AWS用户池登录时,我无法做到这一点。我可以成功注册并完美地连接到用户池(它可以识别错误的密码7个不存在的用户)。当我使用下面所示的方法登录时,我得到了错误: msgstr"检测到1个验证错误:userName处的value null无法满足约束:成员不能为null" 我真的不知道
嗨大家好, 我正在使用AWS S3 SDK 2.2.8将图像上载到S3。我已经在S3控制台中创建了Bucket。 我使用以下代码段上传文件。 我遇到了以下异常: com.amazonaws.AmazonServiceException:检测到1个验证错误:“accountId”处的值“XXXX-XXXX-XXXX”未能满足约束:成员必须满足正则表达式模式:\d(服务:AmazonCongnitoI