protobuf version error

Hi,
When I run my tensorflow model on tx2,something wrong with protobuf version occured.Like this:

nvidia@tegra-ubuntu:~/ext$ python3 test_lanenet.py
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.5.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 "bazel-out/arm-py3-opt/genfiles/tensorflow/contrib/tpu/proto/tpu_embedding_config.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 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 "bazel-out/arm-py3-opt/genfiles/tensorflow/contrib/tpu/proto/tpu_embedding_config.pb.cc".)
Aborted (core dumped)

It meaning that I should update my protobuf from 2.6.1 to 3.5.0, but actually I have already installed protobuf version 3.5.0.post1 inside tx2.
Because when I execute uninstall command like this:

nvidia@tegra-ubuntu:~/ext$ pip3 uninstall protobuf
Uninstalling protobuf-3.5.0.post1:
  Would remove:
    /home/nvidia/.local/lib/python3.5/site-packages/google/protobuf/*
    /home/nvidia/.local/lib/python3.5/site-packages/protobuf-3.5.0.post1-py2.7-nspkg.pth
    /home/nvidia/.local/lib/python3.5/site-packages/protobuf-3.5.0.post1.dist-info/*
Proceed (y/n)? n

It shown that it will uninstall protobuf version 3.5.0.post1
It seems that although I have install protobuf with right version, but tensorflow will always call the wrong version 2.6.1 protobuf.
How can I tell tensorflow to call the installed right version protobuf?

Hi,

Could you try following command if helps?

1. Refresh shared library cache

sudo ldconfig

2. Uninstall library

pip uninstall protobuf==2.6.1

Thanks.

Hi,

I have the same issue. I tried the above, but no luck.

This is the error I am getting:

Using TensorFlow backend.
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library.

I tried to install different versions of tensorflow, but no luck.

I tried to removed and recompiled protobuf 3.6 as specified in https://stackoverflow.com/questions/43937682/upgrading-protobuf-tensorflow-on-jetson-tx2 but still same error.

Some additional info:

$which protoc
/usr/local/bin/protoc

$protoc --version
libprotoc 3.5.0

$pip3 show protobuf

Metadata-Version: 2.0
Name: protobuf
Version: 3.6.1
Summary: Protocol Buffers

Any ideas on how to fix this, would be greatly appreciated.

Thanks!

Hi,

Which TensorFlow package do you use? Do you want to use a custom wheel?
It’s recommended to use our official TensorFlow with JetPack3.3 here:
https://devtalk.nvidia.com/default/topic/1038957/jetson-tx2/tensorflow-for-jetson-tx2-/

Thanks.

Hi,

did you find a solution? I have the same problem.

Thanks

@eric.tondelli, could you extend , please?
are you using instructions from the post above?

what errors are you getting?

Hi,

yes i have installed tensorflow with

pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp33 tensorflow-gpu

I am inside a virtualenv with python 2.7.11+

“import tensorflow” is working

I receive this error when execute my script

"[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.5.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_archive/src/google/protobuf/any.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 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_archive/src/google/protobuf/any.pb.cc".)
Aborted (core dumped)"

With pip show protobuf i get

Name: protobuf
Version: 3.6.1
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/
Author: protobuf@googlegroups.com
Author-email: protobuf@googlegroups.com
License: 3-Clause BSD License
Location: /home/nvidia/Berkeley/lib/python2.7/site-packages
Requires: setuptools, six
Required-by: tensorflow-gpu, tensorboard

Have you any ideas how to solve this error?

Thanks

Hi,

Try this:

sudo pip uninstall protobuf
sudo pip install protobuf==3.5.0
pip show protobuf

Thanks.

Hi AastaLL,

thanks for the reply. Unfortunately i have tried this approach but with no luck.
The only way i have found is to import tensorflow at the beginning of my python file.
If someone have some ideas why it is working can explain me?

Thanks,
Eric

Hi,

I have written a simple python script which has only one line “import tensorflow as tf”.

I am calling the same script from my c++ code (Using Python.h header to call python script from c++ code).

I am getting following error related to libprotobuf.

[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.5.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_archive/src/google/protobuf/any.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 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_archive/src/google/protobuf/any.pb.cc”.)
Aborted (core dumped)

I have tried following things but still it didn’t solve my problem.

  1. sudo pip install protobuf==3.6.1

  2. Installing libprotobuf-dev
    Refer link : https://launchpad.net/ubuntu/disco/arm64/libprotobuf-dev/3.6.1.3-1
    Steps :
    a) uninstall libprotobuf if existing. Command : sudo apt-get remove --purge libprotobuf-dev
    b) Download libprotobuf dependencies (zlib1g-dev, libprotobuf17, libprotobuf-lite17)
    c) Download and Install libprotobuf-dev_3.6.1.

  3. Installing libprotobuf library for c++ from its source code (I installed version 3.5.0)
    Refer link : https://stackoverflow.com/questions/43937682/upgrading-protobuf-tensorflow-on-jetson-tx2
    Steps :

Note: I am using Nvidia Jetson TX2 and I have installed tensorflow using command “sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp33 tensorflow-gpu”.

Please help me solve the above issue. Thanks in advance.

I had similar issues on my Drive PX 2. I ended up building protobuf from sources. Check the details at https://devtalk.nvidia.com/default/topic/1046492/tensorrt/extremely-long-time-to-load-trt-optimized-frozen-tf-graphs/post/5315675/#5315675