Created
September 5, 2019 04:40
-
-
Save yeamusic21/99c0c04811a16d0f444236b6574fac04 to your computer and use it in GitHub Desktop.
Kick off Sagemaker Training
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Notebook Instance Imports | |
import os | |
import sagemaker | |
from sagemaker.tensorflow import TensorFlow | |
# S3 directories | |
data_s3 = 's3://jigsaw-toxic-mjy/' | |
# define inputs | |
inputs = {'data':data_s3} | |
# create estimator | |
estimator = TensorFlow(entry_point='jigsaw_train1_aws2.py', # your training script | |
train_instance_type='ml.p2.xlarge', # instance used for training, usually a GPU instance | |
output_path="s3://jigsaw-toxic-mjy-output", # s3 location to output files | |
train_instance_count=1, # number of instances | |
role=sagemaker.get_execution_role(), # Passes to the container the AWS role that you are using on this notebook | |
framework_version='1.11.0', # Uses TensorFlow 1.11 | |
py_version='py3', | |
script_mode=True) | |
# Run training job | |
estimator.fit(inputs) # run training |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment