來自已部署服務 (AWS CLI) 的要求推論 - Amazon SageMaker

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

來自已部署服務 (AWS CLI) 的要求推論

sagemaker-runtime invoke-endpoint一旦您擁有 Amazon SageMaker 端點InService,就可以使用推論請求進行。您可以使用 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