Tensorflow C++ API and Caffe Compatibility issue related to Glog -


i trying write code in c++ using eclipse ide without bazel. project had perform hacks generate tensorflow c++ apis. tensorflow c++ seems working fine. can load model , perform predictions. have code uses caffe library else. these both seem work fine separately.

the problem

i want integrate both tensorflow , caffe in code. when include both libraries following issue:

in file included /usr/local/include/tf/tensorflow/core/platform/logging.h:25:0,                  /usr/local/include/tf/tensorflow/core/lib/core/status.h:25,                  /usr/local/include/tf/tensorflow/core/framework/variant.h:28,                  /usr/local/include/tf/tensorflow/core/framework/allocator.h:26,                  /usr/local/include/tf/tensorflow/core/framework/tensor.h:22,                  /usr/local/include/tf/tensorflow/cc/framework/ops.h:21,                  /usr/local/include/tf/tensorflow/cc/ops/const_op.h:19,    /usr/local/include/tf/tensorflow/core/platform/default/logging.h:87:0: warning: "log" redefined [enabled default]  #define log(severity) _tf_log_##severity  ^ in file included /bin/caffe-master/distribute/include/caffe/common.hpp:6:0,                  /bin/caffe-master/distribute/include/caffe/blob.hpp:8,                  /bin/caffe-master/distribute/include/caffe/caffe.hpp:7,  class status { /usr/local/include/tf/tensorflow/core/lib/core/status.h:37:14: error: expected unqualified-id before ‘{’ token ../me_t42.cpp:2862:1: error: expected ‘}’ @ end of input  } 

what seems happening both glog , tensorflow seem define same thing log(for example).

is there way solve issue? appreciated.

thank you.

so, if has issue solution this:

add

'#ifndef log_....etc'

//define state gets redefined

'#endif'

and not include

"#xlib.h"

as defines session conflicts session defined in tensorflow c++.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -