[ros-users] [Discourse.ros.org] [General] Announcing the tensorflow_ros package: the easy way to get to C++ Tensorflow API in ROS

Martin Pecka ros.discourse at gmail.com
Thu Jun 14 15:16:41 UTC 2018

We needed to execute some pretrained Tensorflow models in C++ on our robot, and found this task to be pretty difficult to get it right. For Python inference, it's just `<depend>python-tensorflow-pip</depend>` and that's it.

So we wrote a support package [tensorflow_ros](https://github.com/tradr-project/tensorflow_ros) which is a facade hiding the complicated stuff and allowing you to "just" `<depend>tensorflow_ros</depend>` and that's it. An example of use is shown in package [tensorflow_ros_test](https://github.com/tradr-project/tensorflow_ros_test).

The package supports several ways of Tensorflow installation:

* It can "steal" from the files installed by Python's pip, so just installing Tensorflow via pip is enough to get the C++ API! (though it has [some problems](https://github.com/tradr-project/tensorflow_ros#c-abi-difference-problems) on newer systems).
* It supports [tensorflow_catkin](https://github.com/Skydes/tensorflow_catkin)
* It supports custom builds using bazel

The good thing is that by depending on `tensorflow_ros` you don't force users of your package into any specific kind of Tensorflow installation, he can freely choose, and your code stays the same (again, except for the [systems with C++ ABI problems](https://github.com/tradr-project/tensorflow_ros#c-abi-difference-problems)).

By nature of this package, it will never be distributed as a binary package, it always needs to be compiled from source.

Unfortunately, I found out there's [another package with the same name](https://github.com/tue-robotics/image_recognition/tree/master/tensorflow_ros), but they have nothing in common (except Tensorflow).

Let us know if you find it useful!

[Visit Topic](https://discourse.ros.org/t/announcing-the-tensorflow-ros-package-the-easy-way-to-get-to-c-tensorflow-api-in-ros/5112/1) or reply to this email to respond.

More information about the ros-users mailing list