

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# テンソルを保存するように `DebuggerHookConfig` API を設定する
<a name="debugger-configure-tensor-hook"></a>

**注記**  
Amazon SageMaker デバッガーは新規顧客に公開されなくなりました。既存のお客様は、サービスを通常どおり引き続き使用できます。 はデバッガーのセキュリティと可用性の向上に AWS 引き続き投資しますが、新機能を導入する予定はありません。詳細については、「[デバッガーの可用性の変更](debugger-availability-change.md)」を参照してください。

[DebuggerHookConfig](https://sagemaker.readthedocs.io/en/stable/api/training/debugger.html                 #sagemaker.debugger.DebuggerHookConfig) API を使用して、前のステップで作成した `collection_configs` オブジェクトを使用し `debugger_hook_config` オブジェクトを作成します。

```
from sagemaker.core.debugger import DebuggerHookConfig

debugger_hook_config=DebuggerHookConfig(
    collection_configs=collection_configs
)
```

デバッガーは、モデルトレーニング出力テンソルをデフォルトの S3 バケットに保存します。デフォルトの S3 バケット URI の形式は、`s3://amzn-s3-demo-bucket-sagemaker-<region>-<12digit_account_id>/<training-job-name>/debug-output/.` です。

S3 バケット URI を厳密に指定する場合は、次のコード例を使用してください。

```
from sagemaker.core.debugger import DebuggerHookConfig

debugger_hook_config=DebuggerHookConfig(
    s3_output_path="{{specify-uri}}",
    collection_configs=collection_configs
)
```

詳細については、[Amazon SageMaker Python SDK](https://sagemaker.readthedocs.io/en/stable) の「[DebuggerHookConfig](https://sagemaker.readthedocs.io/en/stable/api/training/debugger.html#sagemaker.debugger.DebuggerHookConfig)」を参照してください。