tradr-project/tensorflow_ros_cpp

Error while loading shared libraries when launching a package that requires tensorflow_ros_cpp

kjanu opened this issue · 4 comments

kjanu commented

Tensorflow (please complete the following information):

  • Version: 1.14.0]
  • Installation kind: bazel 0.25.0
  • Using GPU/CUDA/CUDNN: NO

Operating System (please complete the following information):

  • Distribution: Ubuntu 18.04
  • Bitness: 64bits
  • Kernel details: Linux key-desktop 5.4.0-58-generic #64~18.04.1-Ubuntu SMP Wed Dec 9 17:11:11 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

ROS (please complete the following information):

  • Version: Melodic
  • Installation type: system-installed

Describe the bug
I want to run a package [Petra] that requires this package. Tensorflow_catkin was recommended in their readme but that didnt work for me, so I had to install TF via bazel. It build successfully and even tensorflow_ros_cpp was build successfully afterwards via catkin_make. Therefore I added the petra package into my ROS ws. After building that with catkin_make without a problem I wanted to start the launch file of that package. Following error message occured:

NODES
  /
    petra (petra/petra)

ROS_MASTER_URI=http://localhost:11311

/home/key/mero2_ws/devel/lib/petra/petra: error while loading shared libraries: libtensorflow_cc.so.1: cannot open shared object file: No such file or directory
process[petra-1]: started with pid [4912]
[petra-1] process has died [pid 4912, exit code 127, cmd /home/key/mero2_ws/devel/lib/petra/petra __name:=petra __log:=/home/key/.ros/log/d4d3cc42-4133-11eb-8283-d050992bad59/petra-1.log].
log file: /home/key/.ros/log/d4d3cc42-4133-11eb-8283-d050992bad59/petra-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

So it cannot find the shared library object, although the devel/lib folder contains both a symlink to libtensorflow_cc.so and another folder called petra that contains the shared object file, that is also called petra.

$ echo $LD_LIBRARY_PATH knows the path too, it echoes:
/home/key/mero2_ws/devel/lib:/opt/ros/melodic/lib

What am I missing here? Very new to Linux and ROS. Every help is appreciated.

peci1 commented

It is searching for libtensorflow_cc.so.1, not libtensorflow_cc.so (these aren't interchangable). Is such file in your devel/lib? Also, it'd help if you posted the output of CMake phase of building your workspace, where are the logs about how tensorflow_ros_cpp found tensorflow. You can also have a look at the output of ldd devel/lib/petra/petra to see what libraries it links to and if it finds them correctly.

kjanu commented

Thank you. I missed that there is libtensorflow_cc.so.1 and libtensorflow_cc.so and thought it is the same thing. It solved my problem.

Hello, did you manage to compile the tensorflow_catkin package? How is the performance of Petra? I am going to try also

kjanu commented

Hello, did you manage to compile the tensorflow_catkin package? How is the performance of Petra? I am going to try also

Hi, no tensorflow_catkin did not compile for some reason. I cannot quite recall what the issue was. Probably because I use a newer Ubuntu version. However I installed tensorflow_ros_cpp instead. For that I compiled Tensorflow 1.14.0 via bazel 0.25.0. Newer version of Tensorflow do not work with Petra, probably because of the C++ ABI issues that tensorflow_ros_cpp has. Took a lot of days to make it run with Petra.

How is the performance of Petra?

I works, but the performance is mediocre. It has misdetections, where it detects random objects as humans, mostly chairs. But it can figure out humans and their movement, with more or less framedrops. I am using another Lidar than the Petra team used. Mine is a RPLidar. So that might be a problem.