简体   繁体   English

如何在 sagemaker 中构建批量推理的输入/格式?

[英]how to structure input/formats for batch inference in sagemaker?

example provided in the aws documentation, https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html , states that the input csv can be structured like a sample below. aws 文档https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html中提供的示例说明输入 csv 的结构可以像下面的示例一样。 I noticed for batch jobs in sagemaker, it can accept json as well.我注意到 sagemaker 中的批处理作业,它也可以接受 json。 how to structure the json, does each record need to in a single line as shown in a csv example or can it be multiline?如何构建 json,每条记录是否需要像 csv 示例中所示的那样在单行中,还是可以是多行?

Record1-Attribute1, Record1-Attribute2, Record1-Attribute3, ..., Record1-AttributeM
...

It is recommended to make use of JSON Lines (ie each JSON to be on a single line).建议使用JSON Lines (即每个 JSON 在一条线上)。 You can then set BatchStrategy to MultiRecord and SplitType to Line .然后,您可以将 BatchStrategy 设置为 MultiRecord 并将SplitType设置为Line Batch Transform can then fit as many records in a mini-batch within the MaxPayloadInMB limit.然后,批量转换可以在MaxPayloadInMB限制内将尽可能多的记录放入小批量中。

Kindly see the CreateTransformJob API for more information.请参阅CreateTransformJob API 了解更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 优化 sagemaker 上的批量转换推理 - Optimize batch transform inference on sagemaker 如何将输入/输出与 sagemaker 批量转换相匹配? - How to match input/output with sagemaker batch transform? 在 Batch Transform SageMaker 中推理前预处理数据 - Preprocessing data before inference in Batch Transform SageMaker 贤者推理:如何加载model - Sagemaker inference : how to load model 如何通过自定义推理代码在 sagemaker 管道中运行批量转换作业? - how to run a batch transform job in sagemaker pipeline via custom inference code? Amazon Sagemaker:推理端点中的用户输入数据验证 - Amazon Sagemaker: User Input data validation in Inference Endpoint 如何在 SageMaker 实时推理中使用所有 GPU? - How to use all GPUs in SageMaker real-time inference? 如何在 AWS sagemaker 中为 yolov5 推理创建端点 - How can I create an endpoint for yolov5 inference in AWS sagemaker 配备编码器的 Sagemaker 推理端点 - Sagemaker Inference Endpoint with fitted Encoder 如何从使用自定义推理代码的 SageMaker 端点返回带有“text/csv”作为“Content-Type”的浮点数? - How to return a float with 'text/csv' as "Content-Type" from SageMaker endpoint that uses custom inference code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM