

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# TensorFlow 与 Amazon A SageMaker I 配合使用的资源
<a name="tf"></a>

您可以使用 Amazon SageMaker AI 使用自定义 TensorFlow 代码训练和部署模型。 SageMaker AI Python SDK TensorFlow 估算器和模型以及 SageMaker AI 开源 TensorFlow 容器可以提供帮助。根据 TensorFlow 您正在使用的版本和想要执行的操作，使用以下资源列表来查找更多信息。

## TensorFlow 版本 1.11 及更高版本
<a name="tf-script-mode"></a>

对于 1.11 及更高 TensorFlow 版本，[Amaz SageMaker on Python 软件开发工具包](https://sagemaker.readthedocs.io/en/stable)支持脚本模式训练脚本。

### 您需要做什么？
<a name="tf-intent"></a>

我想在 SageMaker AI 中训练一个自定义 TensorFlow 模型。  
有关 Jupyter 笔记本的示例，请参阅[TensorFlow 脚本模式训练和](https://sagemaker-examples.readthedocs.io/en/latest/sagemaker-python-sdk/tensorflow_script_mode_training_and_serving/tensorflow_script_mode_training_and_serving.html)发球。  
有关文档，请参阅[使用训练模型 TensorFlow](https://sagemaker.readthedocs.io/en/stable/using_tf.html#train-a-model-with-tensorflow)。

我有一个在 SageMaker AI 中训练过的 TensorFlow 模型，我想将其部署到托管端点。  
有关更多信息，请参阅[部署 TensorFlow 服务模型](https://sagemaker.readthedocs.io/en/stable/using_tf.html#deploy-tensorflow-serving-models)。

我有一个在 SageMaker AI 之外训练的 TensorFlow 模型，我想将其部署到 A SageMaker I 端点。  
有关更多信息，请参阅[直接使用模型构件部署](https://sagemaker.readthedocs.io/en/stable/using_tf.html#deploying-directly-from-model-artifacts)。

我想查看[亚马逊 SageMaker Python 软件开发工具包 TensorFlow类的](https://sagemaker.readthedocs.io/en/stable) API 文档。  
有关更多信息，请参阅[TensorFlow 估算器](https://sagemaker.readthedocs.io/en/stable/sagemaker.tensorflow.html)。

我想找到 SageMaker AI TensorFlow 容器存储库。  
有关更多信息，请参阅[SageMaker TensorFlow 容器 GitHub 存储库](https://github.com/aws/sagemaker-tensorflow-container)。

我想查找有关 Dee AWS p Learning Containers 支持的 TensorFlow 版本的信息。  
有关更多信息，请参阅[可用的深度学习容器映像](https://github.com/aws/deep-learning-containers/blob/master/available_images.md)。

 有关编写 TensorFlow 脚本模式训练脚本以及在 SageMaker AI 中使用 TensorFlow 脚本模式估计器和模型的一般信息，请参阅与 [Pyth SageMaker on SDK TensorFlow 配合使用](https://sagemaker.readthedocs.io/en/stable/using_tf.html)。

## TensorFlow 1.11 及更早版本的传统模式
<a name="tf-legacy-mode"></a>

[Amaz SageMaker on Python 软件开发工具包](https://sagemaker.readthedocs.io/en/stable)提供了支持 1.11 及更早 TensorFlow 版本的旧模式。在以下情况下，使用传统模式 TensorFlow 训练脚本在 SageMaker AI 中运行 TensorFlow 作业：
+ 您有传统模式脚本，且不想转换为脚本模式。
+ 你想使用早于 1.11 的 TensorFlow 版本。

有关编写与 SageMaker AI Python SDK 配合使用的传统模式 TensorFlow 脚本的信息，请参阅[TensorFlow SageMaker 估算器和模型](https://github.com/aws/sagemaker-python-sdk/tree/v1.12.0/src/sagemaker/tensorflow#tensorflow-sagemaker-estimators-and-models)。