robocar-training/create_job.sh

25 lines
1.0 KiB
Bash
Raw Normal View History

2018-08-03 10:23:18 +00:00
#!/bin/bash
job_name=$1
2019-11-05 18:45:46 +00:00
if [[ -z ${job_name} ]]
2018-08-03 10:23:18 +00:00
then
echo 'Provide model name'
exit 0
2019-11-05 18:45:46 +00:00
fi
2018-08-03 10:23:18 +00:00
echo 'Creating training job '$1
2020-02-17 18:11:48 +00:00
training_image="117617958416.dkr.ecr.eu-west-1.amazonaws.com/robocars:tensorflow"
2019-11-05 18:45:46 +00:00
iam_role_arn="arn:aws:iam::117617958416:role/robocar-training"
DATA_BUCKET="s3://robocars-cyrilix-learning/input"
DATA_OUTPUT="s3://robocars-cyrilix-learning/output"
2018-08-03 10:23:18 +00:00
aws sagemaker create-training-job \
2019-11-05 18:45:46 +00:00
--training-job-name ${job_name} \
2018-08-03 10:23:18 +00:00
--hyper-parameters '{ "sagemaker_region": "\"eu-west-1\"", "with_slide": "true" }' \
2019-11-05 18:45:46 +00:00
--algorithm-specification TrainingImage="${training_image}",TrainingInputMode=File \
--role-arn ${iam_role_arn} \
--input-data-config "[{ \"ChannelName\": \"train\", \"DataSource\": { \"S3DataSource\": { \"S3DataType\": \"S3Prefix\", \"S3Uri\": \"${DATA_BUCKET}\", \"S3DataDistributionType\": \"FullyReplicated\" }} }]" \
--output-data-config S3OutputPath=${DATA_OUTPUT} \
2018-08-03 10:23:18 +00:00
--resource-config InstanceType=ml.p2.xlarge,InstanceCount=1,VolumeSizeInGB=1 \
--stopping-condition MaxRuntimeInSeconds=1800