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

Unable to compile prediction_service.proto for Golang #2186

Open
0110G opened this issue Sep 26, 2023 · 4 comments
Open

Unable to compile prediction_service.proto for Golang #2186

0110G opened this issue Sep 26, 2023 · 4 comments

Comments

@0110G
Copy link

0110G commented Sep 26, 2023

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:

  1. go code by protoc have import cycle not allowed err #634
  2. Unable to compile Protobuf for Golang #1365
  3. Compile gRPC protobufs for Golang #378

To be precise, I am doing the following:

  1. Cloning tensorflow serve repo.
  2. Cloning tensorflow repo
  3. Creating output directory named vendor.
    My directory structure after step 3 looks like:
  - serving:
     - tensorflow_serving
        - apis
  - tensorflow:
     - tensorflow:
       - core
         -...
  - vendor:
  1. 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

@singhniraj08 singhniraj08 self-assigned this Sep 27, 2023
@singhniraj08
Copy link

@0110G,

Can you try using buf’s managed mode to build the TF serving proto files as shown in TF Forum thread. Thank you!

@0110G
Copy link
Author

0110G commented Oct 3, 2023

Checking this out @singhniraj08 Will update this thread.

@0110G
Copy link
Author

0110G commented Oct 3, 2023

Getting tensorflow/core/protobuf/rpc_options.proto:5:15:tsl/protobuf/rpc_options.proto: does not exist while following TF Forum thread

@vicentsegui
Copy link

@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.

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

No branches or pull requests

4 participants