Getting error while importing tensorflow; Error in libprotobuf version

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
  3. Installing libprotobuf library for c++ from its source code
    Refer link : “https://stackoverflow.com/questions/43937682/upgrading-protobuf-tensorflow-on-jetson-tx2

For your information, I am using Nvidia Jetson TX2 and I have installed tensorflow using command “pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp33 tensorflow-gpu”.

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