tensorflow-cmake icon indicating copy to clipboard operation
tensorflow-cmake copied to clipboard

Issues with files generated by newer version of protoc

Open sjdrc opened this issue 6 years ago • 4 comments

I've attempted to compile the examples in this repository after installing eigen and protobuf locally using your scripts. While making the example, I get many errors like this:

In file included from /usr/local/include/google/tensorflow/tensorflow/core/public/session.h:22:0,
                 from /home/sebastien/tensorflow-cmake/examples/install-project/main.cc:1:
/usr/local/include/google/tensorflow/tensorflow/core/framework/device_attributes.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^
/usr/local/include/google/tensorflow/tensorflow/core/framework/device_attributes.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^
/usr/local/include/google/tensorflow/tensorflow/core/framework/device_attributes.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^

What is the issue here? Is my version of TensorFlow too new? Thanks for the help.

sjdrc avatar Oct 19 '17 05:10 sjdrc

Same error here. You found some solution @sjdrc ?

jorgealemangonzalez avatar Nov 02 '17 19:11 jorgealemangonzalez

Hey @jorgealemangonzalez, I ended up using https://github.com/FloopCZ/tensorflow_cc, it was much easier to get working. Check the open issues in the tracker over there, I managed to resolve them fairly painlessly.

sjdrc avatar Nov 02 '17 22:11 sjdrc

I had the same issue: My local system had protoc 3.6 installed, while the generated protobuf files in tensorflow (1.9.0) needed the exact version 3.5. You can look the required version up in the "bazel-genfiles/tensorflow/core/protobuf" folder and cat any of the .h files in the directory. E.g cluster.pb.h specifies in the header:

#if GOOGLE_PROTOBUF_VERSION < 3005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please update
#error your headers.
#endif
#if 3005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please
#error regenerate this file with a newer version of protoc.
#endif

Installing the required version resolved the issue.

Georg-W avatar Jul 22 '18 12:07 Georg-W

I was able to build tensorflow using local dependencies via https://github.com/bazelbuild/bazel/issues/3737#issuecomment-428988517

nkjassal avatar Oct 16 '18 16:10 nkjassal