Skip to content
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

about tf-serving #22

Open
ucasiggcas opened this issue Mar 17, 2022 · 1 comment
Open

about tf-serving #22

ucasiggcas opened this issue Mar 17, 2022 · 1 comment

Comments

@ucasiggcas
Copy link

hi,dear,
after Saved the SavedModel according to the official link, I used the tensorflow-model-server reload the SavedModel, but when I use requests to query, I got the bug bellow,

>>> headers
{'content-type': 'application/json'}
>>> data
'{"signature_name": "serving_default", "instances": [{"age": [46.0], "education_num": [10.0], "capital_gain": [7688.0], "capital_loss": [0.0], "hours_per_week": [38.0]}, {"age": [24.0], "education_num": [13.0], "capital_gain": [0.0], "capital_loss": [0.0], "hours_per_week": [50.0]}]}'
>>> jp=requests.post(url2,data=data,headers=headers)
>>> jp.text
'{\n    "error": "Failed to process element: 0 key: age of \'instances\' list. Error: INVALID_ARGUMENT: JSON object: does not have named input: age"\n}'
@ucasiggcas
Copy link
Author

and the results from saved_model_cli is Okay

saved_model_cli run --dir models/wdSavedModel/1647337804/ --tag_set serve --signature_def="predict" --input_examples='examples=[{"age":[46.], "education_num":[10.], "capital_gain":[7688.], "capital_loss":[0.], "hours_per_week":[38.]}, {"age":[24.], "education_num":[13.], "capital_gain":[0.], "capital_loss":[0.], "hours_per_week":[50.]}]'
Result for output key all_class_ids:
[[0 1]
 [0 1]]
Result for output key all_classes:
[[b'0' b'1']
 [b'0' b'1']]
Result for output key class_ids:
[[1]
 [0]]
Result for output key classes:
[[b'1']
 [b'0']]
Result for output key logistic:
[[0.9291346 ]
 [0.17225692]]
Result for output key logits:
[[ 2.5734713]
 [-1.5697157]]
Result for output key probabilities:
[[0.0708654  0.9291346 ]
 [0.82774305 0.17225692]]

so what's the matter ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant