Invoking endpoint outputs empty prediction data
I am able to invoke my endpoint using the following command template:
aws --profile ‘insert_profile_name’ sagemaker-runtime invoke-endpoint --endpoint-name 'insert_endpoint_name' --body fileb://'insert_image_file_path' --region ‘insert_region’ --content-type application/x-image output.txt
However, this produces an output text file that contains the following:
Also, this appears in the terminal after running the command:
"ContentType": "application/json", "InvokedProductionVariant": "variant-name-1"
The image I used to invoke my endpoint was also used for training the model.
Here is my training job configuration (values that I've modified or added):
Algorithm - Object Detection | Input Mode - Pipe
num_classes - 1 | mini_batch_size - 1 | num_training_samples - 1
Input data configuration:
Name - validation | Input Mode - Pipe | Content Type - application/x-recordio | Record Wrapper - RecordIO | S3 Data Type - AugmentedManifestFile | Attribute Names - source-ref, bounding-box
Name - train | Input Mode - Pipe | Content Type - application/x-recordio | Record Wrapper - RecordIO | S3 Data Type - AugmentedManifestFile | Attribute Names - source-ref, bounding-box
Any help would be appreciated. I can provide more information if needed. Thanks!
Thank you for contacting us.
I understand that you are using the SageMaker Object Detection Algorithm for training and hosting your model and having issues while Invoking endpoint outputs empty prediction data, Please correct me If I am missing anything here.
From the Invocation script I see that you are using content-type as application/x-image, from the documentation I see that the you can Query a trained model by using the model's endpoint and The endpoint takes .jpg and .png image formats with image/jpeg and image/png as content-types.
I would request you to test it out with the
ContentType="image/jpeg" and let us know if you are still facing the issue. As an alternative you can test using the sagemaker runtime API call to invoke the endpoint.
endpoint_response = runtime.invoke_endpoint(EndpointName=ep, ContentType="image/jpeg", Body=b)
For more details please refer to our GitHub example
If you still have difficulties, I recommend to cut a support case and provide more detail about your account information and script/config. Due to security reason, we cannot discuss account specific issue in the public posts.
Invoking endpoint outputs empty prediction dataasked 3 months ago
Could not connect to the endpoint URL: "https://s3.local.amazonaws.com/"asked a year ago
I want to create a folder in the shared top directory of FSx using SSM's PowerShell command.asked 4 months ago
AWS StepFunctions - SageMaker's InvokeEndpoint block throws "validation error" when fetching parameters for itself inside iterator of Map blockAccepted Answerasked 4 months ago
Creating Data Pipeline using Templateasked 2 months ago
How to pass data to an endpointAccepted Answer
Create endpoint from PythonAccepted Answer
An error occurred (ModelError) when calling the InvokeEndpoint operationasked a year ago
Invoke the SageMaker model endpoint directly from PostMan without Lambda and API gateway setupasked 5 months ago
permissions issue with Sagemaker endpoint deploymentasked 2 years ago