Skip to content

Instantly share code, notes, and snippets.

@shashankprasanna
Created April 24, 2020 22:09
Show Gist options
  • Save shashankprasanna/4580c484b103d851c76534e18fafa981 to your computer and use it in GitHub Desktop.
Save shashankprasanna/4580c484b103d851c76534e18fafa981 to your computer and use it in GitHub Desktop.
from sagemaker.tensorflow import TensorFlow
bucket_name = sagemaker_session.default_bucket()
output_path = f's3://{bucket_name}/jobs'
job_name = 'tensorflow-spot-job'
tf_estimator = TensorFlow(entry_point = 'cifar10-training-sagemaker.py',
role = role,
train_instance_count = 1,
train_instance_type = 'ml.p3.2xlarge',
framework_version = '1.15',
...
...
checkpoint_s3_uri = f'{output_path}/{job_name}/checkpoints',
train_use_spot_instances = True,
train_max_wait = 7200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment