

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

# 從部署的服務請求推論 (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
```