• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    Shell
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pre-built TensorFlow for C/C++ and CMake.

TensorFlow C++ CMake

Documentation Build Status

TensorFlow CMake

This repository provides pre-built TensorFlow for C/C++ (headers + libraries) and CMake.

Maintainer: Vassilios Tsounis
Affiliation: Robotic Systems Lab, ETH Zurich
Contact: [email protected]

Overview

This repository provides TensorFlow libraries with the following specifications:

  • Provided versions: 1.15.2 (Default) and 1.13.2
  • Supported for Ubuntu 18.04 LTS.
  • Built with GCC>=7.5.
  • Built with support for C++14.
  • Provides variants for CPU-only and Nvidia GPU respectively.
  • All variants are built with full CPU optimizations available for amd64 architectures.
  • GPU variants are built to support compute capabilities: 5.0, 6.1, 7.0, 7.2, 7.5

NOTE: This repository does not include the TensorFlow source files.

NOTE: As each pre-built distribution of TensorFlow is quite large (~1GB), the tensorflow/CMakeLists.txt CMake script will automatically download and unpack the archive the first time the package is built.

A complete CMake example example is provided for demonstrating how to write dependent packages.

Moreover, we provide additional scripts and tooling for:

  • Downloading, patching and installing Eigen.
  • Building tensorflow from source and extracting all library binaries and headers.

Install

First clone this repository:

git clone https://github.com/leggedrobotics/tensorflow-cpp.git

or if using SSH:

git clone [email protected]:leggedrobotics/tensorflow-cpp.git

Eigen

Each distribution of tensorflow>=r1.13 requires a special patched version of the Eigen header-only library. As of v0.2.0 of this repository, the aforementioned patched header files of Eigen are already included in the the headers downloaded by tensorflow/CMakeLists.txt. However, in certain cases, code in some package A using tensorflow-cpp might interface with some other code in an external package B that also uses Eigen. Thus, in order to ensure that A and B work together properly, we must build both packages using the same version of Eigen.

For such cases, we provide an bash script in tensorflow-cpp/eigen/install.sh.

To download, unpack and patch Eigen:

cd tensorflow-cpp/eigen
./install.sh

To additionally build and install Eigen, the --run-cmake argument can be used:

cd tensorflow-cpp/eigen
./install.sh --run-cmake

NOTE: We recommend installing to ~/.local in order to prevent conflicts with other version of Eigen which may be installed via apt. Eigen exports its package during the build step, so CMake will default to finding the one we just installed unless a HINT is used or CMAKE_PREFIX_PATH is set to another location.

TensorFlow

These are the options for using the TensorFlow CMake package:

Option 1 (Recommended): Installing into the (local) file system

cd tensorflow-cpp/tensorflow
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_BUILD_TYPE=Release ..
make install -j

NOTE: The CMake will download the pre-built headers and binaries at build time and should only happen on the first run.

Option 2 (Advanced): Create symbolic link to your target workspace directory:

ln -s /<SOURCE-PATH>/tensorflow/tensorflow <TARGET-PATH>/

For example, when including as part of larger CMake build or in a Catkin workspace

ln -s ~/git/tensorflow/tensorflow ~/catkin_ws/src/

Use

TensorFlow CMake can be included in other projects either using the find_package command:

...
find_package(TensorFlow CONFIG REQUIRED)
...

or alternatively included directly into other projects using the add_subdirectory command

...
add_subdirectory(/<SOURCE-PATH>/tensorflow/tensorflow)
...

NOTE: By default the CMake package will select the CPU-only variant of a given library version and defining/setting the TF_USE_GPU option variable reverts to the GPU-enabled variant.

User targets such as executables and libraries can now include the TensorFlow::TensorFlow CMake target using the target_link_libraries command.

add_executable(tf_hello src/main.cpp)
target_link_libraries(tf_hello PUBLIC TensorFlow::TensorFlow)
target_compile_features(tf_hello PRIVATE cxx_std_14)

NOTE: For more information on using CMake targets please refer to this excellent article.

Please refer to our complete example for details.

Customize

If a specialized build of TensorFlow (e.g. different verion of CUDA, NVIDIA Compute Capability, AVX etc) is required, then the following steps can be taken:

  1. Follow the standard instructions for installing system dependencies.
    NOTE: For GPU-enabled systems, additional steps need to be taken.
  2. View and/or modify our utility script for step-by-step instructions for building, extracting and packaging all headers and libraries generated by Bazel from building TensorFlow.
  3. Set the TENSORFLOW_ROOT variable with the name of the resulting directory:
cmake -DTENSORFLOW_ROOT=~/.tensorflow/lib -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_BUILD_TYPE=Release ..

Issues

If experiencing any issues please first take a look at our ISSUES.md file. If you are experiencing something we have not accounted for please create a new repository issue.

License

Apache License 2.0

More Repositories

1

darknet_ros

YOLO ROS: Real-Time Object Detection for ROS
C++
2,158
star
2

ros_best_practices

Best practices, conventions, and tricks for ROS
C++
1,477
star
3

legged_gym

Isaac Gym Environments for Legged Robots
Python
1,188
star
4

ocs2

Optimal Control for Switched Systems
C++
802
star
5

elevation_mapping_cupy

Elevation Mapping on GPU.
Python
508
star
6

open3d_slam

Pointcloud-based graph SLAM written in C++ using open3D library.
C++
503
star
7

rsl_rl

Fast and simple implementation of RL algorithms, designed to run fully on GPU.
Python
487
star
8

se2_navigation

Pure Pursuit Control and SE(2) Planning
C++
439
star
9

free_gait

An Architecture for the Versatile Control of Legged Robots
C++
397
star
10

traversability_estimation

Traversability mapping for mobile rough terrain navigation
C++
352
star
11

raisimLib

RAISIM, A PHYSICS ENGINE FOR ROBOTICS AND AI RESEARCH
325
star
12

xpp

Visualization of Motions for Legged Robots in ros-rviz
C++
293
star
13

graph_msf

A graph-based multi-sensor fusion framework. It can be used to fuse various relative or absolute measurments with IMU readings in real-time.
C++
259
star
14

icp_localization

This package provides localization in a pre-built map using ICP and odometry (or the IMU measurements).
C++
258
star
15

viplanner

ViPlanner: Visual Semantic Imperative Learning for Local Navigation
Python
236
star
16

delora

Self-supervised Deep LiDAR Odometry for Robotic Applications
Python
232
star
17

iPlanner

iPlanner: Imperative Path Planning. An end-to-end learning planning framework using a novel unsupervised imperative learning approach
Python
200
star
18

SimBenchmark

Physics engine benchmark for robotics applications: RaiSim vs Bullet vs ODE vs MuJoCo vs DartSim
C++
193
star
19

learning_quadrupedal_locomotion_over_challenging_terrain_supplementary

Supplementary materials for "Learning Locomotion over Challenging Terrain"
C++
173
star
20

raisimGym

Python
141
star
21

art_planner

Local Navigation Planner for Legged Robots
C++
132
star
22

perceptive_mpc

Code for "Perceptive Model Predictive Control for Continuous Mobile Manipulation"
C++
129
star
23

wild_visual_navigation

Wild Visual Navigation: A system for fast traversability learning via pre-trained models and online self-supervision
Python
126
star
24

terrain-generator

Python
108
star
25

vitruvio

Vitruvio is a framework for rapid leg design analysis and optimization for legged robots. The purpose of the simulation framework is to guide the early stages of legged robot design. The end effectors track an input trajectory and the necessary joint speed, torque, power and energy for the tracking is computed.
MATLAB
88
star
26

L3E

Learning-based localizability estimation for robust LiDAR localization.
87
star
27

elmo_ethercat_sdk

C++
80
star
28

MPC-Net

Accompanying code for the publication "MPC-Net: A First Principles Guided Policy Search"
Python
79
star
29

tree_detection

This package implements a simple tree detector from point cloud data. It makes no assumptions about the ground plane and can handle arbitrary terrains.
C++
69
star
30

rayen

Imposition of Hard Convex Constraints on Neural Networks
Python
68
star
31

raisimOgre

https://rsl.ethz.ch/partnership/spinoff/raisim.html
67
star
32

smug_planner

C++
59
star
33

noesis

A Reinforcement Learning Software Toolbox for Robotics
C++
53
star
34

RSLGym

Reinforcement learning framework from RSL for policy training with RaiSim.
Python
48
star
35

hardware_time_sync

Guidelines on how to hardware synchronize the time of multiple sensors, e.g., IMU, cameras, etc.
46
star
36

anomaly_navigation

Anomaly Navigation - ANNA
Python
41
star
37

cerberus_darpa_subt_datasets

Datasets collected by Team CERBERUS during the DARPA Subterranean Challenge
39
star
38

RaiSimUnity

A visualizer for RaiSim based on Unity
31
star
39

raw_image_pipeline

Image processing pipeline for cameras that provide raw data
C++
31
star
40

soem_interface

This software package serves as a C++ interface for one or more EtherCAT devices running on the same bus. The lower level EtherCAT communication is handled by the SOEM library.
C
28
star
41

tcan

A library to communicate to devices connected through CAN, EtherCat, USB or TCP/IP.
C++
28
star
42

swerve_steering

C++
26
star
43

workflows

Collection of workflows, best-practices and guidelines for software development.
Python
26
star
44

radiance_field_ros

Implementation of Radiance Fields for Robotic Teleoperation
Python
25
star
45

terra

A grid world environment for high-level earthworks planning in JAX for RL.
Python
22
star
46

urdf2robcogen

A tool that translates a robot URDF description into the kindsl format that can be processed by RobCoGen.
C++
21
star
47

maxon_epos_ethercat_sdk

Implementation of an ethercat device driver for the maxon epos 4
C++
18
star
48

self_supervised_segmentation

Python
17
star
49

ocs2_robotic_assets

Various robotic assets for OCS2 Toolbox
CMake
17
star
50

cerberus_anymal_locomotion

C++
16
star
51

cuda_ue4_linux

C++
15
star
52

ethercat_sdk_master

A wrapper around SOEM to allow multiple masters and devices on EtherCAT
C++
14
star
53

ethercat_device_configurator

Manages setup yaml files for the RSL ethercat infrastructure
C++
14
star
54

lunar_planner

Python
14
star
55

pytictac

Simple Timing Utils
Python
13
star
56

catkin_create_rqt

An RQT plugin generator script, supporting several arguments to generate a rqt plugin for ROS, similar to catkin_create_pkg
Python
12
star
57

rl-blindloco

Project page for Science Robotics paper "Learning Quadrupedal Locomotion over Challenging Terrain"
HTML
11
star
58

learning_docker

Shell
9
star
59

any_ping_indicator

An Ubuntu indicator applet to show the ping status.
Python
8
star
60

plr-exercise

Python
7
star
61

terra-baselines

Train, visualize, and evaluate RL policies for the Terra environment.
Python
7
star
62

rsl_heap

CMake
7
star
63

anymal_brax

Python
7
star
64

perfectlyconstrained

Official implementations from the paper "Should We Relax a Bit? A Study on Degeneracy Mitigation in Point Cloud Registration"
7
star
65

unity_ros_teleoperation

C#
6
star
66

gtsam_catkin

Catkinized version of gtsam.
CMake
4
star
67

digbench

Benchmarks and map generation for the Terra environment.
Python
4
star
68

mobile_manipulation

Under construction
3
star
69

realsense_eth_robotics_summer_school_2019

Launch files and utility nodes for running the Realsense on SMB
CMake
2
star
70

xpp-release

Release repository of the xpp repo, necessary for ros hosting.
1
star
71

rsl_panoptic_mapping

C++
1
star
72

rsl_panoptic

Python
1
star
73

pretrained_depth_embedders

Python
1
star
74

darknet_ros-release

1
star
75

webapp-container

Scripts and tools to containerize a PHP-FPM, Nginx, Redis web-application ⚙️
Dockerfile
1
star