BhanuKiran
BhanuKiran

Reputation: 3131

What is the difference between protoc and protobuf (Protocol Buffer)

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.

Upvotes: 14

Views: 9418

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1062520

"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)

Upvotes: 19

Related Questions