

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

# Neo の推論エラーをトラブルシューティングする
<a name="neo-troubleshooting-inference"></a>

このセクションでは、エンドポイントのデプロイや呼び出し時に発生する可能性のある一般的なエラーの一部を防ぎ、解決する方法を説明します。このセクションは、**PyTorch 1.4.0 以降**および **MXNet v1.7.0 以降**に当てはまります。
+ 推論スクリプトで `model_fn` を定義していた場合は必ず、有効な入力データに対して最初の推論 (ウォームアップ推論) が `model_fn()` で実行されるようにします。そうでない場合は、[https://sagemaker.readthedocs.io/en/stable/api/inference/predictors.html#sagemaker.predictor.Predictor.predict](https://sagemaker.readthedocs.io/en/stable/api/inference/predictors.html#sagemaker.predictor.Predictor.predict) が呼び出された際に、次のエラーメッセージがターミナルに表示されることがあります。

  ```
  An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (0) from <users-sagemaker-endpoint> with message "Your invocation timed out while waiting for a response from container model. Review the latency metrics for each container in Amazon CloudWatch, resolve the issue, and try again."                
  ```
+ 次の表に示す環境変数が設定されていることを確認します。設定されていない場合は、次のエラーメッセージが表示されることがあります。

  **ターミナル上:**

  ```
  An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (503) from <users-sagemaker-endpoint> with message "{ "code": 503, "type": "InternalServerException", "message": "Prediction failed" } ".
  ```

  **CloudWatch:**

  ```
  W-9001-model-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - AttributeError: 'NoneType' object has no attribute 'transform'
  ```    
[See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/neo-troubleshooting-inference.html)
+ Amazon SageMaker AI モデルを作成する際、必ず `MMS_DEFAULT_RESPONSE_TIMEOUT` 環境変数が500 以上の値に設定されるようにしてください。そうでない場合は、ターミナルに次のエラーメッセージが表示されることがあります。

  ```
  An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (0) from <users-sagemaker-endpoint> with message "Your invocation timed out while waiting for a response from container model. Review the latency metrics for each container in Amazon CloudWatch, resolve the issue, and try again."
  ```