-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ubuntu 16.04 ros-kinetic crashes when loading the node #9
Comments
Hi, can you try building and running https://github.com/tradr-project/tensorflow_ros_test ? |
Thank you for the fast reply. I tried it and the result is the same, I also tried the other branch kinetic-devel which should deal with some of the linking problems but the result is the same. |
Can you please open a terminal in which you source this workspace and send me here the output of the following commands?
|
And did you also try it with the pip-installed tensorflow? Does it work with that one? If you're gonna try it, rather delete the whole build directory, I'm not sure how well does the library cope with changing the tensorflow "provider". |
ldd /home/petrimanninen/segmap_ws/devel/lib/libtensorflow_framework.so
echo $LD_LIBRARY_PATH I guess the third one should be with cat, right?
Answer to your second message is that I first installed the pip version of Tensorflow 1.8.0 but I was unable to get it working because of the C++11ABI incompabilities. I tried to build the tensorflow_ros_cpp first with all the possible settings mentioned here: |
Now that I rebuilt it again in release mode, I get the following output for tensorflow_ros_test:
|
I found this suggestion and tried it but it didn't solve the problem: I added this to CMakelists.txt: |
Hi. I'd first like to verify if at least the pip version works on your machine. Because if not, then there is something else wrong. Here are the steps to get it working in a clean workspace (assuming tensorflow 1.8.0 from pip is already installed):
I see this output:
If you get this working, we can go on with the build. Just to make sure - which version of tensorflow are you building from source? Is it also 1.8.0? As you can see in https://github.com/tradr-project/tensorflow_ros_cpp#ubuntu-1604-64bits-python-276-ros-kinetic, that one is tested and it worked for me. Moreover, the build flags you found should be added to tensorflow build, not to tensorflow_ros_cpp. This might help. |
I tried your instructions to build a new workspace and get the correct packages but I am unable the build the tensorflow because it is not found. I have done a virtual environment where I have pip installed tensorflow-gpu 1.8.0 like this (I used python3, because with python2 I get an setuptools error when trying to install tensorflow) :
Now I thought that maybe I should try to solve it with python2 virtualenv. With python2, when I am trying to install tensorflow, I get:
Now I was able to Install the python2 version and build tensorflow_ws, when I run: I get: But if I try with tensorflow_ros_tes master branch, I cannot build the package because I get:
|
Good, so the build works for you. The master branch of tensorflow_ros_test is expected to fail on Ubuntu Kinetic. Asides from that, it seems you have some serious problems with Python setup :) Things like that usually happen to me when I follow the warnings from pip and run So the basic functionality is capable of working on your system. Now we can proceed with diagnosing the bazel build. Did you manage to add there the required gcc flags? |
No, I actually don't have a clue where to put them :). |
With the bazel build I am also confused, I first used this one from https://www.tensorflow.org/install/source: But it seems like that it is for for the pip installation? Then I found this instruction https://github.com/tradr-project/tensorflow_ros_cpp#prerequisites-2: So my last build is with this one. But this one does not have --config=cuda option, I don't know if I need it or not? Should I also try to bazel build again? |
I guess that this might be correct way to pass the linker options, so I am trying it now: |
Thanks for trying. I know building Tensorflow is a really tedious task. As for the cuda config, I set it during the configure step: https://www.tensorflow.org/install/source#sample_session (click the plus sign to show the sample config session). When you tell the configure script you want CUDA built in, it should not be needed to add anything to the build command (except for the linker flags, which I'm curious if they'll work or not). |
No problem, thanks for you for helping :) I was unable to build tensorflow with the link parameters, error is:
And with --verbose_failures:
|
You can try putting the linker flags here: https://github.com/tensorflow/tensorflow/blob/r1.8/tensorflow/BUILD#L516 . |
Just confirming: Your link is for the branch r1.8 but I am using v1.8.0 but that should be okay, right? |
I think that should be the same. Anyways, I only sent the link to ease you finding the place in the build file you need to change. |
I put the linker flags to the BUILD file as suggested in https://github.com/tensorflow/tensorflow/blob/r1.8/tensorflow/BUILD#L516. I still get the same error :(
|
Oh, that's bad. You can also try building with As a last resort, I'd try building the pip package via bazel, as the official tutorials do. Just make sure to add |
One question, I am not sure that when I add something to the BUILD file, should then use clean or something so that the linker flag options are considered or is it automatic? I was wondering if that's why? I don't know how this bazel works but it seems that in catkin it works that way |
I've no idea, sorry |
Since I was not sure what happened when I added the linker flags and rebuilt tensorflow, I made When it was built and tried to build tensorflow_cpp_ros, I noticed that tensorflow was not found because Now I can confirm that I was able to build the master branch of tensorflow_ros_test and when i run
|
Great! So can you sum up what was needed to get it working? Did you have to change the BUILD file? |
I just reviewed that I am now also able to build and run Segmap. So my setup is Ubuntu 16.04, ROS Kinetic, CUDA 9.0 and cuDNN 7.0. This is the summary about what I needed to do build the Tensorflow 1.8.0 correctly and get it working with tensorflow_ros_cpp package. I downloaded
I had built the tensorflow before and the BUILD file changes didn't take effect before I did clean: Finally built the tensorflow_ros_cpp in the catkin workspace: Great thanks for Martin! Stay safe and healthy during the epidemic :) |
Good to hear you managed to get it working, not everybody is willing to give something such a big effort ;) I'll update the readme with your findings. |
Hey,
I am using Ubuntu 16.04 and I installed tensorflow 1.8.0 from source by following command:
bazel build --config=opt --define framework_shared_object=false tensorflow:libtensorflow_cc.so
I build the tensorflow_ros_cpp with this command:
catkin build tensorflow_ros_cpp --cmake-args -DTF_BAZEL_LIBRARY="/home/petrimanninen/tensorflow/bazel-bin/tensorflow/libtensorflow_framework.so" -DTF_BAZEL_SRC_DIR="/home/petrimanninen/tensorflow"
I made a dummy node with following CMakelists.txt:
And with the following package.xml:
If I add the tensorflow_ros_cpp package as a dependency for my dummy package, ROS crashes immediately with segmentation fault when starting the node (otherwise it runs just fine). The output of GDB backtrace is following:
I assume that ROS is supposed to use the Ubuntu 16.04 provided protobuf version but somehow it gets linked to the tensorflow protobuf which then does not work, but I cannot quite figure out what to do with it?
Could someone please help me with this?
The text was updated successfully, but these errors were encountered: