12

Can some clarify difference between protocol buffer and protoc ?. Googling only shows protocol buffers. I see that naming convention is different for both protobuf-programming language-version and protoc-operating system-86_32. Are they different or same ?

Do i need to install both while working with tensorflow ? Although

protoc --version

is 3.6 but my pip is complaining

tensorflow-gpu 1.7.0 has requirement protobuf>=3.4.0, but you'll have protobuf 2.6.1 which is incompatible.
BhanuKiran
  • 2,631
  • 3
  • 20
  • 36
  • 2
    protoc is a compiler (For ex. generates your java classes from protobuf messages) while protocol buffers is a method to serialise data used for communication or storing the data. You have a version problem with your protobuf library as tensorflow is expecting atleast 3.4.0 version of protobuf but you are having 2.6.1 – Akhil Bojedla Aug 16 '18 at 07:01

1 Answers1

15

"protobuf" or "protocol buffers" is the name of a serialization format and/or associated tooling.

protoc is a specific protobuf tool, specifically Google's implementation of a ".proto" parser and code generator (and a few other things)

".proto" is a schema DSL used for describing the messages you plan to use in your application - it is text based.

The usual process is:

  1. write or obtain a .proto for your messages
  2. run the .proto through protoc or any other library-specific generator tool to obtain the message types for your target platform
  3. add those generated message types to your application
  4. import / reference the protobuf library that matches your chosen tooling / platform
  5. build

Some tools work the other way around, working from your own types in your platform (the "code first" rather than "contract first" approach)

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900