tensorflow / serving

A flexible, high-performance serving system for machine learning models
https://www.tensorflow.org/serving
Apache License 2.0
6.16k stars 2.19k forks source link

The grpc interface used by the serving(docker bazel installed) is different from the grpc.io interface(grpc sourcecode make installed). #1427

Closed HUTOYP closed 5 years ago

HUTOYP commented 5 years ago

Describe the problem

./include/tensorflow_serving/apis/prediction_service.grpc.pb.h: In constructor 'tensorflow::serving::PredictionService::ExperimentalWithCallbackMethod_Classify::ExperimentalWithCallbackMethodClassify()': ./include/tensorflow_serving/apis/predictionservice.grpc.pb.h:308:196: error: wrong number of template arguments (3, should be 2) _new ::grpc::internal::CallbackUnaryHandler< ExperimentalWithCallbackMethodClassify, ::tensorflow::serving::ClassificationRequest, ::tensorflow::serving::ClassificationResponse>(

Describe alternatives you've considered

grpc interface dependent on serving(docker bazel autobuild):

template <class ServiceType, class RequestType, class ResponseType>
class CallbackUnaryHandler : public MethodHandler {
 public:
  CallbackUnaryHandler(
      std::function<void(ServerContext*, const RequestType*, ResponseType*,
                         experimental::ServerCallbackRpcController*)>
          func,
      ServiceType* service)
      : func_(func) {}

grpc sourcecode make:

template <class RequestType, class ResponseType>
class CallbackUnaryHandler : public MethodHandler {
 public:
  CallbackUnaryHandler(
      std::function<void(ServerContext*, const RequestType*, ResponseType*,
                         experimental::ServerCallbackRpcController*)>
          func)
      : func_(func) {}

I want to use the static library version compiled with the official version of grpc,what should I do?

vinuraja commented 5 years ago

Seems like the the grpc version used by Bazel build rules to create the prediction_service.pb.h files are different from the ones installed via grpc io. Unfortunately I am not aware of how to increase the grpc version bazel depends on. Asking on bazel forums might be a good option.

Another alternative would be to try and reduce the version of grpc to something like 1.10.1, according to the details at https://github.com/pubref/rules_protobuf/#rules.

HUTOYP commented 5 years ago

I tried to use V1.14.0(Released on 3 Aug 2018) to the newest version, so It is possible that the older version is right, but I won`t to try temporarily, I can solve this problem by using the Bzel build third_party grpc version.

Thanks.

rmothukuru commented 5 years ago

Closing the issue as it has been answered. Thanks!