

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

# 使用偵錯工具用戶端程式庫建立自訂規則
<a name="debugger-custom-rules"></a>

您可以使用偵錯器規則 API 和開放原始碼 [`smdebug` Python 程式庫](https://github.com/awslabs/sagemaker-debugger/)，均提供工具供您建置自己的規則容器，建立自訂規則以監控訓練任務。

## 建立自訂規則的先決條件
<a name="debugger-custom-rules-prerequisite"></a>

若要建立偵錯器自訂規則，您需要下列先決條件。
+ [SageMaker 偵錯器 Rule.custom API](https://sagemaker.readthedocs.io/en/stable/api/training/debugger.html#sagemaker.debugger.Rule.custom)
+ [開放原始碼 smdebug Python 程式庫](https://github.com/awslabs/sagemaker-debugger/)
+ 您自己的自訂規則 python 指令碼
+ [自訂規則評估工具的 Amazon SageMaker Debugger 映像 URL](debugger-reference.md#debuger-custom-rule-registry-ids)

**Topics**
+ [建立自訂規則的先決條件](#debugger-custom-rules-prerequisite)
+ [使用 `smdebug` 用戶端程式庫來建立自訂規則作為 Python 指令碼](debugger-custom-rules-python-script.md)
+ [使用 Debugger API 執行您自己的自訂規則](debugger-custom-rules-python-sdk.md)