aws / aws/amazon-sagemaker-examples

Tesnorflow iris BYOM error when calling predictor.predict(sample)

Open
#2,917 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

**Link to the notebook**

https://github.com/aws/amazon-sagemaker-examples/blob/master/advanced_functionality/tensorflow_iris_byom/tensorflow_BYOM_iris.ipynb

**Describe the bug**

when I run the cell:

sample = [6.4, 3.2, 4.5, 1.5]
predictor.predict(sample)

I get the error:

ModelError: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received client error (400) from model with message "{ "error": "Failed to process element: 0 of 'instances' list. Error: Invalid argument: JSON Value: 6.4 Type: Number is not of expected type: string" }".

Can you please help me with this?

Contributor guide

Open the contributing guide

Research direction

Open advanced_functionality/tensorflow_iris_byom/tensorflow_BYOM_iris.ipynb and run the cell containing sample and predictor.predict(sample) to reproduce the ModelError. Inspect how the sample is serialized for the endpoint and compare it with the error's expected input type; done means the notebook invocation completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.