"kemptystring is not a number of google::protobuf::internal" while compiling

3,651 views
Skip to first unread message

lixin7...@gmail.com

unread,
Oct 21, 2014, 5:22:56 AM10/21/14
to caffe...@googlegroups.com
This is very strange!!!
I change "caffe.cpp" with nothing but adding a blank space, and the compiling failed!
Actually any change to the code will lead to compiling failure !

Why would this happed ? and how can i solve this?


part of error message is attached

g++ tools/caffe.cpp -pthread -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/cuda/include -Wall -Wno-sign-compare -c -o .build_release/tools/caffe.o 2> .build_release/tools/caffe.o.warnings.txt \
|| (cat .build_release/tools/caffe.o.warnings.txt; exit 1)
In file included from ./include/caffe/blob.hpp:5:0,
                 from ./include/caffe/caffe.hpp:7,
                 from tools/caffe.cpp:8:
.build_release/src/caffe/proto/caffe.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
.build_release/src/caffe/proto/caffe.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
.build_release/src/caffe/proto/caffe.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
In file included from ./include/caffe/blob.hpp:5:0,
                 from ./include/caffe/caffe.hpp:7,
                 from tools/caffe.cpp:8:
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::Datum::clear_data()’:
.build_release/src/caffe/proto/caffe.pb.h:6722:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::Datum::set_data(const string&)’:
.build_release/src/caffe/proto/caffe.pb.h:6732:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::Datum::set_data(const char*)’:
.build_release/src/caffe/proto/caffe.pb.h:6739:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::Datum::set_data(const void*, size_t)’:
.build_release/src/caffe/proto/caffe.pb.h:6746:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘std::string* caffe::Datum::mutable_data()’:
.build_release/src/caffe/proto/caffe.pb.h:6753:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘std::string* caffe::Datum::release_data()’:
.build_release/src/caffe/proto/caffe.pb.h:6760:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h:6764:42: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::NetParameter::clear_name()’:
.build_release/src/caffe/proto/caffe.pb.h:7025:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::NetParameter::set_name(const string&)’:
.build_release/src/caffe/proto/caffe.pb.h:7035:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::NetParameter::set_name(const char*)’:
.build_release/src/caffe/proto/caffe.pb.h:7042:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘void caffe::NetParameter::set_name(const char*, size_t)’:
.build_release/src/caffe/proto/caffe.pb.h:7049:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘std::string* caffe::NetParameter::mutable_name()’:
.build_release/src/caffe/proto/caffe.pb.h:7056:17: error: ‘kEmptyString’ is not a member of ‘google::protobuf::internal’
.build_release/src/caffe/proto/caffe.pb.h: In member function ‘std::string* caffe::NetParameter::release_name()’:

rong john

unread,
Nov 5, 2014, 7:18:19 PM11/5/14
to caffe...@googlegroups.com
I've got similar problem, saying " ‘kEmptyString’ is not a member of ‘google::protobuf::internal’"  in many different member functions.

I don't change any of the code, except the makefile.config.

I use Ubuntu 12.04 LTS, Protobuf 2.6.0, what else information is required for debugging?

Fanglin

unread,
Dec 27, 2014, 11:31:53 AM12/27/14
to caffe...@googlegroups.com
Did you resolve this issue? Seems that you have a wrong version of protobuf. 

Fanglin

Aditya M

unread,
Apr 8, 2015, 7:30:21 AM4/8/15
to caffe...@googlegroups.com
I am also facing same problem.. I am using protobuf 2.6.1 on ubuntu 12.04 LTS.

Any resolution to this issue?

Steven Du

unread,
May 5, 2015, 10:28:06 PM5/5/15
to caffe...@googlegroups.com
Same error, 12.04 LTS with protobuf 2.6.1 

In caffe's doc it says:

Caffe’s Python interface works with Python 2.7. Python 3.3+ should work out of the box without protobuf support. For protobuf support please install protobuf 3.0 alpha (https://developers.google.com/protocol-buffers/). Earlier Pythons are your own adventure.

No idea how they get protobuf 3.0 alpha


在 2015年4月8日星期三 UTC+8下午7:30:21,Aditya M写道:

溫陽鳴

unread,
Jun 12, 2016, 5:34:29 AM6/12/16
to Caffe Users
did u guys solve this problem yet?

lixin7...@gmail.com於 2014年10月21日星期二 UTC+8下午5時22分56秒寫道:

Ethan Zhu

unread,
Nov 29, 2016, 2:24:27 PM11/29/16
to Caffe Users
I solved this by using anaconda python environment, which I highly recommend. 

The install lib is 
protobuf                  3.0.0                    py27_0    anaconda
Reply all
Reply to author
Forward
0 new messages