ethz-asl / segmap

A map representation based on 3D segments
BSD 3-Clause "New" or "Revised" License
1.06k stars 394 forks source link

Issue on catkin build tensorflow_ros_cpp #103

Closed youliangtan closed 5 years ago

youliangtan commented 5 years ago

While building this package, tensor flow is required. Apparently, I faced some problem while running

catkin build tensorflow_ros_cpp

while gave me a error return of

________________________
Errors     << tensorflow_ros_cpp:cmake /home/youliang/segmap_ws/logs/tensorflow_ros_cpp/build.cmake.004.log
-- tensorflow_ros_cpp is probing the system
-- - The system uses C++11 ABI, the use of tensorflow from pip is possible, but problematic; consider compiling tensorflow yourself
-- - Not searching for Tensorflow installed by pip since the system uses C++11 ABI. Set FORCE_TF_PIP_SEARCH to force the search.
-- - Trying to find Tensorflow compiled by bazel
CMake Warning at /home/youliang/segmap_ws/src/tensorflow_ros_cpp/cmake/detect_tf_bazel.cmake:21 (message):
  Bazel-compiled Tensorflow library
  /home/youliang/segmap_ws/devel/../libtensorflow_cc.so not found.
Call Stack (most recent call first):
  CMakeLists.txt:89 (include)

-- - Trying to find Tensorflow from tensorflow_catkin
CMake Warning at /home/youliang/segmap_ws/src/tensorflow_ros_cpp/cmake/detect_tf_catkin.cmake:4 (message):
  tensorflow_catkin was not found
Call Stack (most recent call first):
  CMakeLists.txt:104 (include)

CMake Error at /home/youliang/segmap_ws/src/tensorflow_ros_cpp/CMakeLists.txt:115 (message):
  Tensorflow was not found

cd /home/youliang/segmap_ws/build/tensorflow_ros_cpp; catkin build --get-env tensorflow_ros_cpp | catkin env -si  /usr/bin/cmake /home/youliang/segmap_ws/src/tensorflow_ros_cpp --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/youliang/segmap_ws/devel -DCMAKE_INSTALL_PREFIX=/home/youliang/segmap_ws/install -DCMAKE_BUILD_TYPE=Release; cd -
........................................................
Failed     << tensorflow_ros_cpp:cmake          [ Exited with code 1 ]
Failed    <<< tensorflow_ros_cpp                [ 0.4 seconds ]
[build] Summary: 0 of 1 packages succeeded.             
[build]   Ignored:   30 packages were skipped or are blacklisted.
[build]   Warnings:  None.                              
[build]   Abandoned: None.                              
[build]   Failed:    1 packages failed.                 
[build] Runtime: 0.5 seconds total.              

I have previously installed tensorflow from source, but I have no idea on why this cmake error happened. Hope someone can help me with this. Thanks!

smauq commented 5 years ago

The problem seems it's not finding the tensorflow installation. Can you give more details on your system/setup and how you installed tensorflow?

youliangtan commented 5 years ago

I tried pip install tensorflow, install tensorflow 1.8 from source, and also catkin build tensorflow_catkin package. All tensorflow installation succeed. Still the segmap compilation is unable to find the tensorflow package. Srry Iam unfamiliar with this, hope some useful information can help me out. Thanks alot

smauq commented 5 years ago

From the error message I see you are probably on Ubuntu 16 or 18. This means you need to build tensorflow from source and install it using pip into your environment. Afterwards when you compile tensorflow_ros_cpp, see here on the cmake flags you need to set during compilation. You will need to at least specify this flag FORCE_TF_PIP_SEARCH as ON. In case it doesn't work try also correctly specifying the other flags related to python version, pip and library location.

smauq commented 5 years ago

Here's a more in-depth explanation of the required flags: https://github.com/ethz-asl/segmap/wiki/FAQ#q-issues-compiling-tensorflow_ros_cpp

ludennis commented 5 years ago

Thanks, @smauq.

Had the same question of not knowing what --cmake-args to set when using custom-compiled tensorflow. Got it solved using your link.

Much appreciated,

Dennis