

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

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

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

```
from sagemaker.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.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)」を参照してください。