Hi All,
I am following the tutorial from the below link with same versions mentioned in it.
https://github.com/EdjeElectronics/TensorFlow-Object-Detection-on-the-Raspberry-Pi
However I have encountered the below error message.
pi@raspberrypi:~/protobuf-3.5.1/python $ python3 setup.py build --cpp_implementation
running build
running build_py
running build_ext
building 'google.protobuf.pyext._message' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I../src -I/usr/include/python3.7m -c google/protobuf/pyext/descriptor_database.cc -o build/temp.linux-armv7l-3.7/google/protobuf/pyext/descriptor_database.o -Wno-write-strings -Wno-invalid-offsetof -Wno-sign-compare
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I../src -I/usr/include/python3.7m -c google/protobuf/pyext/repeated_composite_container.cc -o build/temp.linux-armv7l-3.7/google/protobuf/pyext/repeated_composite_container.o -Wno-write-strings -Wno-invalid-offsetof -Wno-sign-compare
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I../src -I/usr/include/python3.7m -c google/protobuf/pyext/descriptor_containers.cc -o build/temp.linux-armv7l-3.7/google/protobuf/pyext/descriptor_containers.o -Wno-write-strings -Wno-invalid-offsetof -Wno-sign-compare
google/protobuf/pyext/descriptor_containers.cc: In function ‘bool google::protobuf::python::descriptor::_GetItemByKey(google::protobuf::python::PyContainer, PyObject, const void*)’:
google/protobuf/pyext/descriptor_containers.cc:69:45: error: invalid conversion from ‘const char’ to ‘char’ [-fpermissive]
(((charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0):
~~~~~^~~
google/protobuf/pyext/descriptor_containers.cc:172:13: note: in expansion of macro ‘PyString_AsStringAndSize’
if (PyString_AsStringAndSize(key, &name, &name_size) < 0) {
^~~~~~
google/protobuf/pyext/descriptor_containers.cc:69:45: error: invalid conversion from ‘const char’ to ‘char’ [-fpermissive]
((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0):
~~~~~^~~~~
google/protobuf/pyext/descriptor_containers.cc:189:13: note: in expansion of macro ‘PyString_AsStringAndSize’
if (PyString_AsStringAndSize(key, &camelcase_name, &name_size) < 0) {
^~~~~~~~
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
What version of protobuf and what language are you using?
Version: master/v3.6.0/v3.5.0 etc.
--> Protobuf version 3.5
Tensorflow version that I am using is 1.14.0
Language: C++/Java/Python/C#/Ruby/PHP/Objective-C/Javascript
--> Python 3.7.3
What operating system (Linux, Windows, ...) and version?
--> Raspbian
What runtime / compiler are you using (e.g., python version or gcc version)
--> python 3.7.3
[GCC 8.2.0] on linux
What did you do?
Steps to reproduce the behavior:
followed steps from the above tutorial link untill the error message.
I got error on this line. "python3 setup.py build --cpp_implementation"
What did you expect to see
Compile without errors
What did you see instead?
Error message.
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment
I am trying to build object detection model on my Raspberry pi 4 model B.
Please let me know for any additional details required for resolving it.
Getting the same thing during the librealsense installation. I'm gonna try and ignore the error for now.
Raspbian Buster? More like buster of dependencies amirite. Nothing ever compiles properly on this damn thing.
You can fix it by these:
$ find ./google/protobuf/ -name *.cc -exec sed -i "s/= PyUnicode_AsUTF8AndSize/= (char*)PyUnicode_AsUTF8AndSize/g" {} ;
Most helpful comment
You can fix it by these:
$ find ./google/protobuf/ -name *.cc -exec sed -i "s/= PyUnicode_AsUTF8AndSize/= (char*)PyUnicode_AsUTF8AndSize/g" {} ;