YesIndeedy
YesIndeedy

Reputation: 161

upgrading protobuf tensorflow on jetson tx2

To give as much background as possible -

I have a machine learning model trained using keras i'm trying to embed on an nvidia jetson tx2.

I have set up tensorflow on there (a bit of a pain in itself) however when i run my script i'm hitting an error with protobuf.

Using TensorFlow backend. [libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.1.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. 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 "external/protobuf/src/google/protobuf/any.pb.cc".) terminate called after throwing an instance of 'google::protobuf::FatalException' what(): This program requires version 3.1.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. 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 "external/protobuf/src/google/protobuf/any.pb.cc".) Aborted (core dumped)

So - i upgraded protobuf using pip at first but i thought the clash is because c++ version is taking priority and the version in linux was still stating 2.6.1 however after building in c++ the version is now shown as 3.1.0 however i am still getting the same error.

From the nvidia dev forums i received some feedback

"/usr/lib/aarch64-linux-gnu/libprotobuf.so.9.0.1

This means that C/C++ code will find version 2.6.

pip install protobuf-3.1.0-py2.py3-none-any.whl

This means that Python code will find version 3.1.

You need to upgrade the C++ (system) library to match version 3.1.

I don't think there's a default package on Ubuntu that does this, so you will have to either hack it by building your own and installing it on top of the system package, or you will have to find a deb package that has a newer version that will still install on your current system."

Ive really been struggling with this as i cant find a way to upgrade the system files. Any help would be much appreciated

Thanks

edit: i'm also wondering could this be a clash with GTK (i am also using openCV here so thats worth a mention!)

Upvotes: 0

Views: 1639

Answers (2)

Sirosh Bashir
Sirosh Bashir

Reputation: 479

step 1: first, uninstall with purge protobuf sudo apt-get remove --purge libprotobuf

step 2: start a fresh one

$ wget https://raw.githubusercontent.com/jkjungavt/jetson_nano/master/install_protobuf-3.6.1.sh

sudo chmod +x install_protobuf-3.6.1.sh ./install_protobuf-3.6.1.sh #this time will take 30 min on my board.

Upvotes: 1

Haozhe Xie
Haozhe Xie

Reputation: 3656

Please check your version of libprotobuf-dev.

Please try to uninstall your existing one on your PC with following commands:

apt-get remove --purge libprotobuf-dev

Then, build new version of libprotobuf-dev:

apt-get install autoconf automake libtool curl make g++ unzip
wget https://github.com/google/protobuf/releases/download/v3.5.0/protobuf-cpp-3.5.0.tar.gz
tar -xvf protobuf-cpp-3.5.0.tar.gz
cd protobuf-3.5.0
./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig

Good luck.

References:

Upvotes: 1

Related Questions