

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

# デプロイされたサービスからの推論のリクエスト (AWS CLI)
<a name="neo-requests-cli"></a>

Amazon SageMaker AI エンドポイント `InService` を取得すると、[https://docs.aws.amazon.com/cli/latest/reference/sagemaker-runtime/invoke-endpoint.html](https://docs.aws.amazon.com/cli/latest/reference/sagemaker-runtime/invoke-endpoint.html) を使用して推論リクエストを行えます。推論リクエストは、 AWS Command Line Interface (AWS CLI) を使って行えます。次の例は、推論用のイメージを送信する方法を示しています。

```
aws sagemaker-runtime invoke-endpoint --endpoint-name {{'insert name of your endpoint here'}} --body fileb://image.jpg --content-type=application/x-image output_file.txt
```

推論が成功した場合は、推論リクエストに関する情報が含まれた `output_file.txt` が作成されます。

 TensorFlow の場合、コンテンツタイプが `application/json` の入力を送信します。

```
aws sagemaker-runtime invoke-endpoint --endpoint-name {{'insert name of your endpoint here'}} --body fileb://input.json --content-type=application/json output_file.txt
```