Unable to compile prediction_service.proto for Golang
0110G opened this issue · comments
Bug Report
If this is a bug report, please fill out the following form in full:
System information
- **OS Platform and Distribution : macOS Bigsur 11.4
- TensorFlow Serving installed from (source or binary): Source (Using Docker pull tensorflow/serving)
- TensorFlow Serving version: 2.13.0
Describe the problem
I want to serve realtime predictions from a pretrained model using tf serve. While I am able to use RESTful APIs and getting correct predictions, I am not able to use gRPC methods for optimising my response times.
Exact Steps to Reproduce
I tried following these approaches before raising this issue:
To be precise, I am doing the following:
- Cloning tensorflow serve repo.
- Cloning tensorflow repo
- Creating output directory named
vendor
.
My directory structure after step 3 looks like:
- serving:
- tensorflow_serving
- apis
- tensorflow:
- tensorflow:
- core
-...
- vendor:
- Trying to generate Go file using
protoc -I tensorflow -I serving --go_out=vendor --go_opt=paths=source_relative --go-grpc_out=vendor --go-grpc_opt=paths=source_relative serving/tensorflow_serving/apis/prediction_service.proto
protoc --version = libprotoc 24.3
Source code / logs
I am getting the following error:
protoc-gen-go: unable to determine Go import path for "tensorflow_serving/apis/input.proto"
Please specify either:
• a "go_package" option in the .proto source file, or
• a "M" argument on the command line.
See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.
I tried using M argument as specified but still faced the same issue for some other file.
Please help
Can you try using buf’s managed mode to build the TF serving proto files as shown in TF Forum thread. Thank you!
Checking this out @singhniraj08 Will update this thread.
Getting tensorflow/core/protobuf/rpc_options.proto:5:15:tsl/protobuf/rpc_options.proto: does not exist
while following TF Forum thread
@0110G In case you are still stuck I have a Bazel based minimal proto library in https://github.com/PantaPasen/tensorflow-serving-apis-proto/tree/2.15, adding Bazel go proto libs on top of it or a buf generation should be fairly easy.