[英]How can I use the model.ckpt Files from Tensorflow Training on Google Cloud for making predictions?
[英]How can I use a list of files as the training set on Sagemaker with Tensorflow?
我的训练文件夹中有几百万张图像,并且想要指定其中的一个子集进行训练 - 执行此操作的方法似乎是使用此处描述的清单文件。
https://docs.aws.amazon.com/sagemaker/latest/dg/augmented-manifest.html
但这似乎是针对标记数据的。 如何使用 sagemaker 的 Tensorflow estimator.fit
以文件列表而不是整个目录作为输入来开始 sagemaker 培训工作?
您可以使用输入类型 pipe 参数,如下所示:
hyperparameters = {'save_checkpoints_secs':None,
'save_checkpoints_steps':1000}
tf_estimator = TensorFlow(entry_point='./my-training-file', role=role,
training_steps=5100, evaluation_steps=100,
train_instance_count=1, train_instance_type='ml.p3.2xlarge',
input_mode = 'Pipe',
train_volume_size=300, output_path = 's3://sagemaker-pocs/test-carlsoa/kepler/model',
framework_version = '1.12.0', hyperparameters=hyperparameters, checkpoint_path = None)
并创建清单文件 pipe 作为输入:
train_data = sagemaker.session.s3_input('s3://sagemaker-pocs/test-carlsoa/manifest.json',
distribution='FullyReplicated',
content_type='image/jpeg',
s3_data_type='ManifestFile',
attribute_names=['source-ref'])
#attribute_names=['source-ref', 'annotations'])
data_channels = {'train': train_data}
请注意,您可以使用 ManifestFile 或 AugmentedManifestFile,具体取决于您是否需要提供额外的数据或标签。 现在您可以使用 data_channels 作为 tf 估计器的输入:
tf_estimator.fit(inputs=data_channels, logs=True)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.