Skip to content

Improve error message for prediction api mismatch #176

@deliahu

Description

@deliahu

Description

Currently, this is the error message:

$ cx predict iris samples.json 
error: prediction failed for sample: {"petal_length": 1.4, "bad_name": 0.3, "sepal_width": 3.6, "sepal_length": 5.2} ('bad_name')

This should return more helpful information: at least that "bad_name" is not an input feature, and the correct input schema if possible

Update

As of febc293, the raw signature_def is shown on all errors. Rather than showing it on all exceptions, it would be better to validate before making the request to TF Serving (since then the schema won't be shown if the error isn't due to invalid input types).

Also, the formatting of the message should be prettier (e.g. show the python datatypes instead of TF types, and don't show the irrelevant info in the signature_def).

One concern: how to distinguish between array inputs or scalar inputs? After initial research, the signature_def seemed to look the same for scalars (e.g. iris) or arrays (e.g. mnist).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions