Use TensorFlow with Amazon SageMaker - Amazon SageMaker

Use TensorFlow with Amazon SageMaker

You can use Amazon SageMaker to train and deploy a model using custom TensorFlow code. The SageMaker Python SDK TensorFlow estimators and models and the SageMaker open-source TensorFlow containers make writing a TensorFlow script and running it in SageMaker easier.

Use TensorFlow Version 1.11 and Later

For TensorFlow versions 1.11 and later, the Amazon SageMaker Python SDK supports script mode training scripts.

What do you want to do?

I want to train a custom TensorFlow model in SageMaker.

For a sample Jupyter notebook, see TensorFlow script mode training and serving.

For documentation, see Train a Model with TensorFlow.

I have a TensorFlow model that I trained in SageMaker, and I want to deploy it to a hosted endpoint.

For more information, see Deploy TensorFlow Serving models.

I have a TensorFlow model that I trained outside of SageMaker, and I want to deploy it to a SageMaker endpoint

For more information, see Deploying directly from model artifacts.

I want to see the API documentation for Amazon SageMaker Python SDK TensorFlow classes.

For more information, see TensorFlow Estimator.

I want to find the SageMaker TensorFlow container repository.

For more information, see SageMaker TensorFlow Container GitHub repository.

I want to find information about TensorFlow versions supported by AWS Deep Learning Containers.

For more information, see Available Deep Learning Container Images.

For general information about writing TensorFlow script mode training scripts and using TensorFlow script mode estimators and models with SageMaker, see Using TensorFlow with the SageMaker Python SDK.

Use TensorFlow Legacy Mode for Versions 1.11 and Earlier

The Amazon SageMaker Python SDK provides a legacy mode that supports TensorFlow versions 1.11 and earlier. Use legacy mode TensorFlow training scripts to run TensorFlow jobs in SageMaker if:

  • You have existing legacy mode scripts that you do not want to convert to script mode.

  • You want to use a TensorFlow version earlier than 1.11.

For information about writing legacy mode TensorFlow scripts to use with the SageMaker Python SDK, see TensorFlow SageMaker Estimators and Models.