【发布时间】:2018-06-30 03:45:24
【问题描述】:
我已经通过 sagemaker 实现了机器学习算法。
我已经为 .net 安装了 SDK,并通过执行以下代码进行了尝试。
Uri sagemakerEndPointURI = new Uri("https://runtime.sagemaker.us-east-2.amazonaws.com/endpoints/MyEndpointName/invocations");
Amazon.SageMakerRuntime.Model.InvokeEndpointRequest request = new Amazon.SageMakerRuntime.Model.InvokeEndpointRequest();
request.EndpointName = "MyEndpointName";
AmazonSageMakerRuntimeClient aawsClient = new AmazonSageMakerRuntimeClient(myAwsAccessKey,myAwsSecreteKey);
Amazon.SageMakerRuntime.Model.InvokeEndpointResponse resposnse= aawsClient.InvokeEndpoint(request);
通过执行此操作,我收到验证错误为“1 validation error detected: Value at 'body' failed to satisfy constraint: Member must not be null”
谁能指导我如何以及需要传递哪些输入数据来调用给定的 API?
编辑
我进一步尝试通过提供包含由“.gz”或“.pkl”文件写入的 MemoryStream 的主体参数来尝试,它给我的错误是:“从 AWS 解组响应时出错,HTTP 内容长度超过 5246976字节。”
编辑 2018 年 1 月 23 日
进一步我想出了错误消息
错误 - 模型服务器 - 'TypeError' 对象没有属性 'message'
谢谢
【问题讨论】:
-
为什么这是一个
sparkr的问题?? -
我已经使用 SparkR 训练模型洞察 Sagemaker notebook。
-
我不是 .NET 专家,但您缺少应该保存推理输入的 Body 属性:docs.aws.amazon.com/sdkfornet/v3/apidocs/Index.html
-
我进一步尝试通过提供包含由“.gz”文件写入的 MemoryStream 的主体参数来尝试,它给我的错误是:“错误从 AWS 解组响应”
标签: c# amazon-web-services amazon-s3 sparkr amazon-sagemaker