Last active
January 19, 2019 00:11
-
-
Save ResidentMario/835a68d536645c0d04897aef8bea088d to your computer and use it in GitHub Desktop.
This file contains 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
import sagemaker as sage | |
sess = sage.Session() | |
transformer = sagemaker.transformer.Transformer( | |
base_transform_job_name='Batch-Transform', | |
model_name='sagemaker-demo-[...]', # insert model name here | |
instance_count=1, | |
instance_type='ml.c4.xlarge', | |
output_path='s3://quilt-example/quilt_sagemaker_demo/outputs', | |
sagemaker_session=sess | |
) | |
# start an example prediction job | |
transformer.transform( | |
's3://quilt-example/quilt/fashion_mnist/fashion-mnist_train.csv', | |
content_type='text/csv', | |
split_type='Line' | |
) | |
# wait until prediction job is completed | |
transformer.wait() | |
# get the data in the read the resulting file | |
import boto3 | |
s3_client = boto3.resource('s3') | |
s3_client.download_file('s3://quilt-example/', 'quilt_sagemaker_demo/model/[...]') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment