我已经成功地训练了与sagemaker一个LDA模型,我已经能够建立一个推理API,但它有我多少条记录可以同时查询的限制。
我需要得到的预测为大文件,并且一直在尝试使用批量转换但是我运行针对路障。
我的输入日期是在应用程序/ x-recordio-protobuf的内容类型,代码如下:
# Initialize the transformer object
transformer =sagemaker.transformer.Transformer(
base_transform_job_name='Batch-Transform',
model_name=model_name,
instance_count=1,
instance_type='ml.c4.xlarge',
output_path=output_location,
max_payload=20,
strategy='MultiRecord'
)
# Start a transform job
transformer.transform(input_location, content_type='application/x-recordio-protobuf',split_type="RecordIO")
# Then wait until the transform job has completed
transformer.wait()
# Fetch validation result
s3_client.download_file(bucket, 'topic_model_batch_transform/output/batch_tansform_part0.pbr.out', 'batch_tansform-result')
with open('batch_tansform-result') as f:
results = f.readlines()
print("Sample transform result: {}".format(results[0]))
我已经输入文件分块到每个10个文件大小约为19MB。 我在第一次尝试在一个单一的块上运行,因此总共19MB。 我试图改变策略,试图SingleRecord。 我也尝试过不同的split_types,也试图和无“线”。
我读过的文件,但它不清楚还有什么我应该尝试,也是错误信息是非常不清楚。
2019-04-02T15:49:47.617:[sagemaker logs]: MaxConcurrentTransforms=1, MaxPayloadInMB=20, BatchStrategy=MULTI_RECORD
#011at java.lang.Thread.run(Thread.java:748)2019-04-02T15:49:48.035:[sagemaker logs]: du-sagemaker/data/batch_transform/batch_tansform_part0.pbr: Bad HTTP status returned from invoke: 413
2019-04-02T15:49:48.036:[sagemaker logs]: du-sagemaker/data/batch_transform/batch_tansform_part0.pbr:
2019-04-02T15:49:48.036:[sagemaker logs]: du-sagemaker/data/batch_transform/batch_tansform_part0.pbr: Message:
2019-04-02T15:49:48.036:[sagemaker logs]: du-sagemaker/data/batch_transform/batch_tansform_part0.pbr: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2019-04-02T15:49:48.036:[sagemaker logs]: du-sagemaker/data/batch_transform/batch_tansform_part0.pbr: <title>413 Request Entity Too Large</title>
2019-04-02T15:49:48.036:[sagemaker logs]: du-sagemaker/data/batch_transform/batch_tansform_part0.pbr: <h1>Request Entity Too Large</h1>
2019-04-02T15:49:48.036:[sagemaker logs]: du-sagemaker/data/batch_transform/batch_tansform_part0.pbr: <p>The data value transmitted exceeds the capacity limit.</p>
以上是最后一个我上面的配置了,在那之前我也得到了一个400 HTTP错误代码。
任何帮助或指针将不胜感激! 谢谢