Add a gRPC client in C++ for inception serving. - #300
Conversation
|
Can one of the admins verify this patch? |
| using tensorflow::serving::PredictResponse; | ||
| using tensorflow::serving::PredictionService; | ||
|
|
||
| const std::string SERVING_HOST = "localhost:9000"; |
There was a problem hiding this comment.
Make these parameters configurable
There was a problem hiding this comment.
Yes, please update SERVING_HOST to something like ADDRESS and make flag configurable.
Input file name should also be flag configurable.
And please s/SERVICE_NAME/MODEL_NAME, and make configurable. Can default to "inception".
Thanks!
|
|
||
|
|
||
| int main(int argc, char** argv) { | ||
| // Expect only arg: --db_path=path/to/route_guide_db.json. |
There was a problem hiding this comment.
I don't think we need this here
| for(iter = map_outputs.begin();iter != map_outputs.end(); ++iter){ | ||
| std::cout << "output " << output_index << " name is "<< iter->first << std::endl; | ||
|
|
||
| std::cout << "output " << output_index << " type is "<< |
There was a problem hiding this comment.
Looks like we can probably reuse helper methods from tensorflow/core/framework/tensor.cc, specifically
Tensor::FromProto and Tensor::DebugString(). This should let you delete the code from here to approx line 120 of the current PR.
| }; | ||
|
|
||
|
|
||
| std::string GetImagePath(int argc, char** argv) { |
There was a problem hiding this comment.
Can you please try tensorflow::Flag(...), which will allow you to delete this method?
nfiedel
left a comment
There was a problem hiding this comment.
Thanks for submitting this PR and apologies for the delayed reply. This is definitely useful, both for inception and as an example for others wanting to create gRPC clients.
Please take a look at the comments and ping back when ready for another review.
Thanks!
…sult make the server_address/model_name/image_file configurable using Tensorflow flag
|
@nfiedel @tobegit3hub Thanks for your review, and I rewrote the code mentioned in the comments.The parameter processing and output are now using the methods provided by tensorflow. Would you please give another review? |
|
Hi isiosia@, @tensorflow-jenkins : test this please |
|
Is there a way to build the C++ gRPC client on Windows? |
|
@atisman89 were you able to do this eventually? |
* Add an inception client in cc. * use the Tensor::FromProto and Tensor::SummarizeValue to output the result make the server_address/model_name/image_file configurable using Tensorflow flag
|
Hi all, |
#281
This is a gRPC client which written in C++ and can run with the inception serving demo.
Build this demo with the following command:
bazel build tensorflow_serving/example:inception_client_cc
And run:
bazel-bin/tensorflow_serving/example/inception_client_cc --image=/file/to/my_cat.jpg