我创建了一个自定义模型并将其部署在sagemaker上。我正在使用批处理转换作业来调用端点。如果输入文件较小(即csv文件中的行数较少),则此方法有效。如果我上传的文件大约有200000行,那么我在cloudwatch日志中会收到此错误。
2018-11-21 09:11:52.666476: W external/org_tensorflow/tensorflow/core/framework/allocator.cc:113]
Allocation of 2878368000 exceeds 10% of system memory.
2018-11-21 09:11:53.166493: W external/org_tensorflow/tensorflow/core/framework/allocator.cc:113]
Allocation of 2878368000 exceeds 10% of system memory.
[2018-11-21 09:12:02,544] ERROR in serving: <_Rendezvous of RPC that
terminated with:
#011status = StatusCode.DEADLINE_EXCEEDED
#011details = "Deadline Exceeded"
#011debug_error_string = "
{
"created": "@1542791522.543282048",
"description": "Error received from peer",
"file": "src/core/lib/surface/call.cc",
"file_line": 1017,
"grpc_message": "Deadline Exceeded",
"grpc_status": 4
}
"
任何想法可能出什么问题。这是我用来创建转换作业的转换函数。
transformer =sagemaker.transformer.Transformer(
base_transform_job_name='Batch-Transform',
model_name='sagemaker-tensorflow-2018-11-21-07-58-15-887',
instance_count=1,
instance_type='ml.m4.xlarge',
output_path='s3://2-n2m-sagemaker-json-output/out_files/'
)
input_location = 's3://1-n2m-n2g-csv-input/smal_sagemaker_sample.csv'
transformer.transform(input_location, content_type='text/csv', split_type='Line')
.csv文件包含两列客户的名字和姓氏,然后我使用input_fn()在sagemaker本身中对其进行预处理。
答案 0 :(得分:0)
该错误似乎来自GRPC客户端在服务器能够响应之前关闭了连接。 (https://github.com/aws/sagemaker-tensorflow-container/issues/46上似乎有针对sagemaker tensorflow容器的功能请求,以使此超时可配置)
您可以尝试使用Sagemaker Transformer进行一些操作,以限制每个单独请求的大小,以使其适合超时:
max_payload
设置为较小的值,例如2-3 MB(the default is 6 MB)max_concurrent_transforms
> 1以利用多个工作线程答案 1 :(得分:0)
进行了更改并合并到其中,以允许用户通过环境变量SAGEMAKER_TFS_GRPC_REQUEST_TIMEOUT配置超时。