Amazon SageMaker
Developer Guide

Use TensorFlow with Amazon SageMaker

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

For a sample Jupyter notebook, see

For documentation, see Train a Model with TensorFlow.

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

Deploy TensorFlow Serving models.

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

Deploying directly from model artifacts.

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

TensorFlow Estimator

I want to see information about Amazon SageMaker TensorFlow containers.

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

For information about TensorFlow versions supported by the Amazon SageMaker TensorFlow container, see

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 Amazon 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 Amazon SageMaker Python SDK, see