models icon indicating copy to clipboard operation
models copied to clipboard

Syntaxnet - TensorFlow 0.9

Open borisstock opened this issue 10 years ago • 7 comments

Innocent as I am, I've tried to update the TensorFlow submodule used by the Syntaxnet model to the release 0.9 to make usage of the new option to compile it with GPU support on Mac OS X.

Now I'm running into some protobuf problems I can not explain:

In file included from syntaxnet/unpack_sparse_features.cc:26:
In file included from external/tf/tensorflow/core/framework/op_kernel.h:26:
In file included from external/tf/tensorflow/core/framework/function.h:24:
bazel-out/local-opt/genfiles/external/tf/tensorflow/core/framework/graph.pb.h:127:3: error: unknown type name 'PROTOBUF_DEPRECATED_ATTR'
  PROTOBUF_DEPRECATED_ATTR void clear_version();
  ^
bazel-out/local-opt/genfiles/external/tf/tensorflow/core/framework/graph.pb.h:127:28: error: expected member name or ';' after declaration specifiers
  PROTOBUF_DEPRECATED_ATTR void clear_version();
  ~~~~~~~~~~~~~~~~~~~~~~~~ ^
bazel-out/local-opt/genfiles/external/tf/tensorflow/core/framework/graph.pb.h:128:3: error: unknown type name 'PROTOBUF_DEPRECATED_ATTR'
  PROTOBUF_DEPRECATED_ATTR static const int kVersionFieldNumber = 3;
  ^
bazel-out/local-opt/genfiles/external/tf/tensorflow/core/framework/graph.pb.h:128:28: error: expected member name or ';' after declaration specifiers
  PROTOBUF_DEPRECATED_ATTR static const int kVersionFieldNumber = 3;
  ~~~~~~~~~~~~~~~~~~~~~~~~ ^
bazel-out/local-opt/genfiles/external/tf/tensorflow/core/framework/graph.pb.h:129:3: error: use of undeclared identifier 'PROTOBUF_DEPRECATED_ATTR'
  PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int32 version() const;
  ^
bazel-out/local-opt/genfiles/external/tf/tensorflow/core/framework/graph.pb.h:130:3: error: unknown type name 'PROTOBUF_DEPRECATED_ATTR'
  PROTOBUF_DEPRECATED_ATTR void set_version(::google::protobuf::int32 value);
  ^
bazel-out/local-opt/genfiles/external/tf/tensorflow/core/framework/graph.pb.h:130:28: error: expected member name or ';' after declaration specifiers
  PROTOBUF_DEPRECATED_ATTR void set_version(::google::protobuf::int32 value);
  ~~~~~~~~~~~~~~~~~~~~~~~~ ^
bazel-out/local-opt/genfiles/external/tf/tensorflow/core/framework/graph.pb.h:380:23: error: out-of-line definition of 'clear_version' does not match any declaration in 'tensorflow::GraphDef'
inline void GraphDef::clear_version() {
                      ^~~~~~~~~~~~~
bazel-out/local-opt/genfiles/external/tf/tensorflow/core/framework/graph.pb.h:387:23: error: out-of-line definition of 'set_version' does not match any declaration in 'tensorflow::GraphDef'
inline void GraphDef::set_version(::google::protobuf::int32 value) {
                      ^~~~~~~~~~~

If I build the tensorflow submodule by itself, it compiles without any problems, but not when built with the syntaxnet bazel build commands.

Can someone point me in the direction what would be necessary to get SyntaxNet working with TensorFlow 0.9? I would be happy to invest some time into that...

borisstock avatar Jun 06 '16 18:06 borisstock

@calberti: Can you take a look?

girving avatar Jun 07 '16 20:06 girving

Updating the tensorflow submodule definitely requires some changes in syntaxnet. We'll update the tf submodule with future release -- or feel free to send us a pull request if you get syntaxnet to work at with a more recent tf.

calberti avatar Jun 22 '16 16:06 calberti

In terms of direction for fixing this, this is a problem with protocol buffers generated code. There are probably changes needed in https://github.com/tensorflow/models/blob/master/syntaxnet/WORKSPACE and https://github.com/tensorflow/models/blob/master/syntaxnet/syntaxnet/BUILD.

calberti avatar Jun 22 '16 16:06 calberti

Thank you very much for the directions! I will definitely invest time into this.

borisstock avatar Jun 22 '16 16:06 borisstock

Actually, have you seen this pull request? https://github.com/tensorflow/models/pull/204 It might be relevant.

calberti avatar Jun 22 '16 17:06 calberti

👍 thanks a lot. of course!

borisstock avatar Jun 22 '16 17:06 borisstock

BTW I've been using syntaxnet with TF master with the referenced PR and it passes tests and also works fine with some other changes we're working on. The main issue TBD (which is mentioned in the PR) is that due to a bug in bazel, the "if_cuda" macro doesn't work properly when used inside syntaxnet. (I don't have a fantastic workaround for that other than to patch the code in third_party/gpus/cuda/build_defs.bzl in a way that makes it work in syntaxnet, but break if TF is built directly (which I don't do currently)).

dmansfield avatar Jun 22 '16 19:06 dmansfield