Skip to content

Unable to compile prediction_service.proto for Golang #2186

Open
@0110G

Description

@0110G

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions