cjweeks / tensorflow-cmake

Integrate TensorFlow with CMake projects effortlessly
MIT License
332 stars 80 forks source link

Issues with files generated by newer version of protoc #31

Open sjdrc opened 7 years ago

sjdrc commented 7 years ago

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.

jorgealemangonzalez commented 7 years ago

Same error here. You found some solution @sjdrc ?

sjdrc commented 7 years ago

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.

Georg-W commented 6 years ago

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.

nkjassal commented 6 years ago

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