SageMaker

SageMaker

LocalStack Pro provides a local version of the SageMaker API, which allows running jobs to create machine learning models (e.g., using TensorFlow).

A basic example using the sagemaker.tensorflow.TensorFlow class is provided in this Github repository. Essentially, the code boils down to these core lines:

  1. inputs = ... # load training data files
  2. mnist_estimator = TensorFlow(entry_point='mnist.py', role='arn:aws:...',
  3. framework_version='1.12.0', sagemaker_session=sagemaker_session,
  4. train_instance_count=1, training_steps=10, evaluation_steps=10)
  5. mnist_estimator.fit(inputs, logs=False)

The code snippet above uploads the model training code to local S3, submits a new training job to the local SageMaker API, and finally puts the trained model back to an output S3 bucket. Please refer to the sample repo for more details.

Note: SageMaker is a fairly comprehensive API - for now, only a subset of the functionality is provided locally, but new features are being added on a regular basis.

Last modified October 8, 2021: rename Local AWS Services to aws (fa6b2e4a)