I am getting this error:
./google/protobuf/generated_message_util.h:86: const string& google::protobuf::internal::GetEmptyStringAlreadyInited(): Assertion `empty_string_ != __null' failed.
I have been trying to fix this all day long. So the flow in my project goes like this:
I have a C++ project that I compile using CMake on Ubuntu 16.10. After some processing I want to send the data to a Python script that uses Keras for machine learning.
Now both of these scripts work perfectly independently. I wanted to send the data directly to the Python script. So I have embedded Python in C++ by referring this link
This is again working for a Python script that does not import keras.
Now when I import keras in this Python script, I get the above error, though both of them work properly independetly.
First I had got an error for the mismatch of libprotobuf and protoc versions which looked like:
Using TensorFlow backend. [libprotobuf FATAL google/protobuf/stubs/common.cc:67] This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 3.0.0. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "google/protobuf/descriptor.pb.cc".) terminate called after throwing an instance of 'google::protobuf::FatalException' what(): This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 3.0.0. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "google/protobuf/descriptor.pb.cc".) Aborted (core dumped)
I had installed protoc using apt-get (latest available on apt-get is 3.0.0) as I found out on one of the answers that you need not have protoc 3.5.0 for it to work. pip3 install protobuf
installs protobuf 3.5.0 which resulted in the mismatch error message.
So I uninstalled this Python protobuf version and installed the older version using pip3 install protobuf==3.0.0
. This removed the mismatch error message.
But now I am getting the aforementioned error message. I have also figured out that the error message is occuring due to Tensorflow dependency of Keras
How do I fix this?
Please help