

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 PyTorch 搭配 Amazon SageMaker AI 的資源
<a name="pytorch"></a>

您可以使用 Amazon SageMaker AI 來訓練和部署模型，方法為使用自訂 PyTorch 程式碼。SageMaker AI Python SDK PyTorch 估算器和模型，以及 SageMaker AI 開放原始碼 PyTorch 容器，讓撰寫 PyTorch 指令碼以及在 SageMaker AI 中執行該指令碼變得更輕鬆。下節提供參考資料，您可以用來了解如何使用 PyTorch 搭配 SageMaker AI。

## 您想要做什麼？
<a name="pytorch-intent"></a>

我想要在 SageMaker AI 中訓練自訂 PyTorch 模型。  
如需範例 Jupyter 筆記本，請參 Amazon SageMaker AI 範例 GitHub 程式庫中的 [PyTorch 範例筆記本](https://github.com/awslabs/amazon-sagemaker-examples/tree/master/sagemaker-python-sdk/pytorch_mnist)。  
如需文件 , 請參閱[使用 PyTorch 訓練模型](https://sagemaker.readthedocs.io/en/stable/using_pytorch.html#train-a-model-with-pytorch)。

我有已在 SageMaker AI 中訓練的 PyTorch 模型，而且想要將其部署到託管端點。  
如需詳細資訊，請參閱[部署 PyTorch 模型](https://sagemaker.readthedocs.io/en/stable/using_pytorch.html#deploy-pytorch-models)。

我有已在 SageMaker AI 外訓練的 PyTorch 模型，而且想要將其部署到 SageMaker AI 端點  
如需詳細資訊，請參閱[部署您自己的 PyTorch 模型](https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#bring-your-own-model)。

我想要參閱[ Amazon SageMaker Python SDK](https://sagemaker.readthedocs.io/en/stable) PyTorch 類別的 API 文件。  
如需詳細資訊，請參閱[ PyTorch 類別](https://sagemaker.readthedocs.io/en/stable/sagemaker.pytorch.html)。

我想要尋找 SageMaker AI PyTorch 容器儲存庫。  
如需詳細資訊，請參閱 [SageMaker AI PyTorch 容器 GitHub 儲存庫](https://github.com/aws/deep-learning-containers/tree/master/pytorch)。

我想要尋找 AWS Deep Learning Containers 支援的 PyTorch 版本相關資訊。  
有關詳細資訊，請參閱[可用的深度學習容器映像](https://github.com/aws/deep-learning-containers/blob/master/available_images.md)。

 如需撰寫 PyTorch 訓練指令碼，以及使用 PyTorch 估算器和模型搭配 SageMaker AI 的一般相關資訊，請參閱[使用 PyTorch 搭配 SageMaker Python SDK](https://sagemaker.readthedocs.io/en/stable/using_pytorch.html)。