-
Notifications
You must be signed in to change notification settings - Fork 834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] REST request gets parsed to String if any of the element in Numpy array is String #745
Comments
I think this might be expected if we are passing the data in the python wrapper as a numpy array as numpy dtype would probably be object or string. |
Thanks @cliveseldon. I was wondering if there should be some smarter dtype indication in Numpy. For example in Pandas, we can set dtype to object , and then use |
Yes, for multitype data at present its expected you would need to cast to the correct types as numpy will assign a single type. You could pass via binData, strData or jsonData fields we also provide. Each has their own pros/cons. |
OK I will try converting pandas to binary , hopefully the deserialization won't affect the original data types. Thanks @cliveseldon |
Can someone show me what would the Model class look like if a binary data is passed to predict function. Looks like I need to override |
The internal container endpoint would be the same https://docs.seldon.io/projects/seldon-core/en/latest/python/python_component.html#low-level-methods |
Yeah I noticed that reference and thought it should work that way. However, from my local test looks like the wrapper did not chose |
That error would imply its not finding the payload in the REST request. Can you try with: https://docs.seldon.io/projects/seldon-core/en/latest/workflow/api-testing.html#microservice-api-tester |
I was able to override |
Predict raw will simply pass the messgae that was received to the user_model:
So it should be the whole SeldonMessage as a Dict or proto It presently expects a SeldonMesage proto returned, |
@lennon310 Any update on whether this is still an issue? |
Thank you @cliveseldon . I was try to serialize the numpy (or json) to a byte data and send it with Seldon Client. Looks like I should add them to Seldon Message as you suggested. I haven't worked on this part yet, but I guess this issue can be closed since it was initially asking about the data type in REST. |
If I'm sending a request on
/predict
with payload:the parsed numpy array is
[[7.233, 4.652, 7.39, 0.324]]
.However, if the payload is
the parsed Nunpy array is
[["str", "4.652", "7.39", "0.324"]]
(Note the data types are all converted to String instead of keep the last 3 as floats).The text was updated successfully, but these errors were encountered: