tobegit3hub / simple_tensorflow_serving

Generic and easy-to-use serving service for machine learning models
https://stfs.readthedocs.io
Apache License 2.0
757 stars 193 forks source link

"error":"Invalid json data: #25

Closed Johnson-yue closed 6 years ago

Johnson-yue commented 6 years ago

Thank your reply! I check your update and still questions:

  1. I run simple_tensorflow_serving --model_base_path="./models/tensorflow_template_application_model" and then run curl http://localhost:8500/v1/models/__tensorflow_template_application_model__/gen_client?language=python > client.py but the shell output:

    zsh: no matches found: http://localhost:8500/v1/models/tensorflow_template_application_model/gen_client?language=python

  2. I replace tensorflow_template_application_model with default in model_config_file.json like this: image and the I run simple_tensorflow_serving --model_config_file="./examples/model_config_file.json" simple_tensorflow_serving is runing: image

In other terminal, I run python client.py: image the output is like this : image

So. I have test your web _Test function: image result is the same. I can not get right result..

My input_data of client.py is wrong??

Johnson-yue commented 6 years ago

your docker image is everything OK.

tobegit3hub commented 6 years ago

It seems to be the problem of input json. Make sure you use the "gen_client" and the clients in this repo.

Did you run your server with Python3?

Johnson-yue commented 6 years ago

@tobegit3hub yes,my python version is 3.5, by the way ,do you know how can I convert checkpoint files(such as: .data-0000-of-0001, .meta, .index) to SavedModel for tf serving (like : saved_model.pb, variables )?

tobegit3hub commented 6 years ago

It is the problem of Python version compatibility. Issue refers to https://stackoverflow.com/questions/41314572/invalid-json-data-from-requests-get .

I will test with the :latest-py34 docker image and fix it soon.

For another issue, you can write the Python script to load the checkpoint and export SavedModel.

tobegit3hub commented 6 years ago

Another issue for Python 3 in https://stackoverflow.com/questions/18686903/dict-keys0-on-python-3 .

And we use has_key in tensorflow_inference_service.py.