-
Notifications
You must be signed in to change notification settings - Fork 824
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
Not able to pass string as input to the predict function. #2553
Comments
Can you try with 1.3.0 release? |
@cliveseldon could you let me know whether I am passing the proper input in curl file. |
if you wrapped your python with the standard
|
Can you please explain why it is not working on Seldon Version 1.0.1? |
Is the error in the logs of the seldon engine or in your model itself? It looks like you are not sending a valid SeldonMessage payload. |
No error is not in the model. I have tried running the predict function inside the container, it gives the output as desired. |
Can you try with 1.3? |
Yeah I would try running it in 1.3 |
Hi @girishpillai17, sorry for taking so long to get back to you. curl -s -H 'Content-Type: application/json' \
-d '{"strData": "my input string"}' \
http://localhost:8003/seldon/seldon/seldon-mock-model/api/v1.0/predictions I have just verified that this works with
build using curl -s -H 'Content-Type: application/json' \
-d '{"strData": "my input string"}' \
http://localhost:8003/seldon/seldon/seldon-mock-model/api/v1.0/predictions | jq .
{
"meta": {
"puid": "covbn9km55d3qp77fi8iv7k7lm",
"tags": {},
"routing": {},
"requestPath": {
"model": "mock-model:latest"
},
"metrics": []
},
"strData": "my input string"
} |
curl -v http://10.144.98.247:32027/seldon/seldon/wc-nbmodel-girish-pillai/api/v0.1/predictions -H 'Content-Type: application/json' -d '{"strData": "www.microsoft.com"}'
I tried using strData, but still getting the same error. |
Please, provide version of seldon-core wrapper used to build the image and the manifest yaml file used to create the deployment. |
Also, please post logs from the model container. When trying to run code from the repo you linked in first message I hit multiple problems:
Once those were fixed there was still errors on unpickling your model both with Python 3.6 and 3.7. Please confirm that there are no Python errors reported in the model container as well as please try if the minimal example posted by me works as expected. |
seldon-core wrapper - seldonio/seldon-core-s2i-python3:0.13 Can you send me any similar example for string input which is in seldon core github so that I can refer it? I didnt get what is manifest yaml file. |
Please, try with For example:
|
I am using the below code
And my environment variable is I have kept the model name same as class name. So what is the discrepancy? |
|
Thank you for all the help and support you have provided. Thanks once again for looking into it. Input: output:
|
I have deployed a website classification model via seldon.
The link to the repo is : Model file
Describe the bug
So basically the model accepts string as an input and gives the category name as output
Eg: model.predict("www.microsoft.com") will give output as ['Computers']
I tried to run the model by going inside the container, the model runs without any bugs. But when I try to pass the curl function and the json. I get the below error
{ "status": { "code": 203, "info": "com.google.protobuf.InvalidProtocolBufferException: Expect message object but got: \"\u003c!DOCTYPE\"", "reason": "Microservice error", "status": "FAILURE" } }
I have passed curl file in many combination but I dont get the desired output.
curl -v http://10........../api/v0.1/predictions -H "Content-Type: application/json" -d '{'url' : 'www.microsoft.com'}'
curl -v http://10........../api/v0.1/predictions -H "Content-Type: application/json" -d "{"url" : "www.microsoft.com"}"
curl -v http://10........../api/v0.1/predictions -d '{"url" : "www.microsoft.com"}' -H "Content-Type: application/json"
curl -v http://10........../api/v0.1/predictions -H 'Content-Type: application/json' -d '{ "data": { "ndarray": [["www.microsoft.com"]]}}'
curl -v http://10........../api/v0.1/predictions -H 'Content-Type: application/json' '{"data": {"names": [], "ndarray": [["www.microsoft.com"]]}}'
Expected behaviour
Expected behaviour should be that after receiving the string input, it should give the category name as a list
E.g : ['Category_name']
Environment
Kubernetes V1.16.6
Docker Version 18.06.2 Seldon Version 1.0.1
The text was updated successfully, but these errors were encountered: