トレーニングジョブの投⼊と完了
import sagemaker
from sagemaker.estimator import Estimator
hyperparameters = {'train-steps': 5}
estimator = Estimator(image_uri=‘999999999999.dkr.ecr.ap-northeast-1.amazonaws.com/sagemaker-example:latest’,
role="arn:aws:iam::999999999999:role/SagemakerJobRunner”,
instance_count=1,
instance_type='ml.p2.xlarge’,
max_run=24 * 60 * 60,
input_mode='File’,
output_path='s3://sagemaker-examples.rails.to/output’,
base_job_name='Sagemaker-Example’,
hyperparameters=hyperparameters,
use_spot_instances=True,
max_wait=24 * 60 * 60,
checkpoint_s3_uri='s3://sagemaker-examples.rails.to/checkpoints’)
estimator.fit('s3://sagemaker-examples.rails.to/input/data/training')
15