tensorflow_cpp
Helpful model wrappers around TensorFlow C++ API
Science Score: 72.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
2 of 3 committers (66.7%) from academic institutions -
✓Institutional organization owner
Organization ika-rwth-aachen has institutional domain (www.ika.rwth-aachen.de) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.1%) to scientific vocabulary
Keywords
Repository
Helpful model wrappers around TensorFlow C++ API
Basic Info
Statistics
- Stars: 20
- Watchers: 4
- Forks: 1
- Open Issues: 0
- Releases: 7
Topics
Metadata Files
README.md
tensorflow_cpp
tensorflow_cpp is a header-only library that provides helpful wrappers around the TensorFlow C++ API, allowing you to easily load, inspect, and run saved models and frozen graphs in C++. The library is easy to integrate into CMake projects, but is also available as a ROS and ROS2 package.
[!IMPORTANT]
This repository is open-sourced and maintained by the Institute for Automotive Engineering (ika) at RWTH Aachen University.
Deep Learning is one of many research topics within our Vehicle Intelligence & Automated Driving domain.
If you would like to learn more about how we can support your deep learning or automated driving efforts, feel free to reach out to us!
Timo Woopen - Manager Research Area Vehicle Intelligence & Automated Driving
+49 241 80 23549
timo.woopen@ika.rwth-aachen.de
If you are looking for an easy way to install the TensorFlow C++ API, we suggest that you also check out our repository libtensorflow_cc. There, we provide a pre-built library and a Docker image for easy installation and usage of the TensorFlow C++ API.
Examples
Loading and running a single-input/single-output model
```cpp
include
include
include
include
include
// load single-input/single-output model std::string modelpath = "/PATH/TO/MODEL"; tensorflowcpp::Model model; model.loadModel(model_path);
// log model info std::cout << model.getInfoString() << std::endl;
// get input/output shape/type, if required
std::vector
// create and fill input tensor tensorflow::Tensor input_tensor; // ... fill input tensor ...
// run model tensorflow::Tensor outputtensor = model(inputtensor); ```
Loading and running a multi-input/multi-output model
```cpp #includeLoading and running a multi-input/multi-output model with specific inputs/outputs
```cpp #includeInstallation
Dependencies
tensorflow_cpp is a wrapper around the official TensorFlow C++ API. The C++ API including libtensorflow_cc.so must be installed on the system.
Instead of having to build the C++ API from source yourself, we recommend to check out our repository libtensorflow_cc. There, we provide a pre-built library and a Docker image for easy installation and usage of the TensorFlow C++ API.
Installation is as easy as the following. Head over to libtensorflow_cc for more details.
ARCH=$(dpkg --print-architecture)
wget https://github.com/ika-rwth-aachen/libtensorflow_cc/releases/download/v2.9.2/libtensorflow-cc_2.9.2-gpu_${ARCH}.deb
sudo dpkg -i libtensorflow-cc_2.9.2-gpu_${ARCH}.deb
ldconfig
If you have already installed the C++ API another way, you can use the provided TensorFlowConfig.cmake to enable the find_package(TensorFlow REQUIRED) call in tensorflow_cpp's CMakeLists.txt.
CMake
Clone this repository.
bash git clone https://github.com/ika-rwth-aachen/tensorflow_cpp.git cd tensorflow_cppInstall tensorflow_cpp system-wide.
```bash
tensorflow_cpp$
mkdir -p build cd build cmake .. sudo make install ```
Use
find_package()to locate and integrate tensorflow_cpp into your CMake project. See the CMake example project.```cmake
CMakeLists.txt
findpackage(tensorflowcpp REQUIRED)
...
addexecutable(foo ...) # / addlibrary(foo ...)
...
targetlinklibraries(foo tensorflow_cpp) ```
ROS/ROS2
Clone this repository into your ROS/ROS2 workspace.
bash git clone https://github.com/ika-rwth-aachen/tensorflow_cpp.git cd tensorflow_cppIn order to include tensorflow_cpp in a ROS/ROS2 package, specify the dependency in its
package.xmland usefind_package()in your package'sCMakeLists.txt.xml <!-- package.xml --> <depend>tensorflow_cpp</depend>```cmake
CMakeLists.txt
ROS
findpackage(catkin REQUIRED COMPONENTS tensorflowcpp )
ROS2
findpackage(tensorflowcpp REQUIRED) amenttargetdependencies(
tensorflow_cpp) ```
Testing
In order to build and run the test cases defined in tests/, execute the following.
```bash
tensorflow_cpp$
mkdir -p build cd build cmake -DBUILD_TESTING=ON .. make ctest ```
Documentation
Click here to be taken to the full API documentation.
The documentation can be generated by running Doxygen.
```bash
tensorflow_cpp/doc$
doxygen ```
Acknowledgements
This work is accomplished within the projects 6GEM (FKZ 16KISK038) and UNICARagil (FKZ 16EMO0284K). We acknowledge the financial support for the projects by the Federal Ministry of Education and Research of Germany (BMBF).
Notice
This repository is not endorsed by or otherwise affiliated with TensorFlow or Google. TensorFlow, the TensorFlow logo and any related marks are trademarks of Google Inc. TensorFlow is released under the Apache License 2.0.
Owner
- Name: Institut für Kraftfahrzeuge, RWTH Aachen, ika
- Login: ika-rwth-aachen
- Kind: organization
- Location: Aachen, Germany
- Website: https://www.ika.rwth-aachen.de
- Repositories: 16
- Profile: https://github.com/ika-rwth-aachen
Citation (CITATION.cff)
cff-version: 1.2.0
title: ika-rwth-aachen/tensorflow_cpp
doi: 10.5281/zenodo.7227948
type: software
repository-code: "https://github.com/ika-rwth-aachen/tensorflow_cpp.git"
authors:
- given-names: Lennart
family-names: Reiher
email: "lennart.reiher@rwth-aachen.de"
affiliation: "Institute for Automotive Engineering (ika), RWTH Aachen University"
orcid: 0000-0002-7309-164X
- given-names: Bastian
family-names: Lampe
email: "bastian.lampe@rwth-aachen.de"
affiliation: "Institute for Automotive Engineering (ika), RWTH Aachen University"
orcid: 0000-0002-4414-6947
- given-names: Raphael
family-names: van Kempen
email: "raphael.vankempen@ika.rwth-aachen.de"
affiliation: "Institute for Automotive Engineering (ika), RWTH Aachen University"
orcid: 0000-0001-5017-7494
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Lennart Reiher | l****r@i****e | 46 |
| FabianThomsen | 5****n | 7 |
| Lukas Zanger | l****r@i****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 2
- Total pull requests: 8
- Average time to close issues: about 2 months
- Average time to close pull requests: 1 day
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 4.0
- Average comments per pull request: 0.13
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- zjd1988 (1)
- BKjungle (1)
Pull Request Authors
- lreiher (5)
- FabianThomsen (3)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v3 composite
- actions/checkout v3 composite
- mattnotmitt/doxygen-action v1.1.0 composite
- peaceiris/actions-gh-pages v3 composite
- actions/checkout v3 composite