← Open Source
FloopCZ

tensorflow_cc

Build and install TensorFlow C++ API library.

Model DevelopmentDeep Learning FrameworksShell
Open on GitHub
Momentum
+0stars in 24 hours0.0%
762
Stars
179
Forks
+0
This week
10
Contributors
Created 2017-05-24 · Updated 2026-10-02 · #14094 today
Top developers
FloopCZmrdaliriachalshah20

FloopCZ/tensorflow_cc is ranked 14,094 with 762 stars.

Same-category comparison

FloopCZ/tensorflow_cc is ranked 14,094 among these 8 peers; yingkaisha/keras-unet-collection is ranked 14,090.

Same-category comparison
NameRankMetrics
stepjam/PyRep14,087
Language:
Python
Stars:
763
Forks:
177
Description:
A toolkit for robot learning research.
techascent/tech.ml.dataset14,088
Language:
Clojure
Stars:
763
Forks:
34
Description:
A Clojure high performance data processing system.
yeyupiaoling/PaddlePaddle-DeepSpeech14,089
Language:
Python
Stars:
763
Forks:
146
yingkaisha/keras-unet-collection14,090
Language:
Python
Stars:
763
Forks:
185
Description:
The Tensorflow, Keras implementation of U-net, V-net, U-net++, UNET 3+, Attention U-net, R2U-net, ResUnet-a, U^2-Net, TransUNET, and Swin-UNET with optional ImageNet-trained backbones.
attractivechaos/kann14,098
Language:
C
Stars:
762
Forks:
122
Description:
A lightweight C library for artificial neural networks.
liruilong940607/prope14,100
Language:
Python
Stars:
762
Forks:
13
Description:
Cameras as Relative Positional Encoding.
safe-graph/DGFraud14,101
Language:
Python
Stars:
762
Forks:
167
Description:
A Deep Graph-based Toolbox for Fraud Detection.
NVlabs/ToolOrchestra14,104
Language:
Python
Stars:
761
Forks:
110
Description:
ToolOrchestra is an end-to-end RL training framework for orchestrating tools and agentic workflows.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguageShell
CategoryModel Development
SubcategoryDeep Learning Frameworks
Stars762
Forks179
Contributors10
Created date2017-05-24
Updated date2026-10-02
Stars in 1 day0
Stars in 7 days0
Rank14,094
Previous rank13,965
Rank change-129
7-day stars rank14,291
Previous 7-day stars rank14,306
7-day stars rank change15
Total stars rank13,892
Previous total stars rank13,871
Total stars rank change-21
CountryCzech Republic
README summary

tensorflow_cc This repository makes possible the usage of the TensorFlow C++ API from the outside of the TensorFlow source code folders and without the use of the Bazel build system. This repository contains two CMake projects. The tensorflow_cc project downloads, builds and installs the TensorFlow C++ API into the operating system and the example project demonstrates its simple usage. Docker If you wish to start using this project right away, fetch a prebuilt image on Docker Hub! , run

: Installation 1) Install requirements Ubuntu 18. 04: Install repository requirements: Set up Python 3 to be the default Python: In order to build the TensorFlow itself, the build procedure also requires Bazel: If you require GPU support on Ubuntu, please also install NVIDIA CUDA Toolkit (>=11. The build procedure will automatically detect CUDA if it is installed in or directories. Arch Linux: For GPU support on Arch, also install the following: **Warning:** Newer versions of TensorFlow sometimes fail to build

with the latest version of Bazel. You may wish to install an older version of Bazel (e. **Warning:** If your program uses Protobuf and you encounter linkage or other problems, you can try option to install a Protobuf version matching the version bundled with TensorFlow. Our Dockerfiles are already built with the right version of Protobuf, so you may want to try your program in the Dockerfile first. 2) Clone this repository 3) Build and install the library **Warning:** Optimizations

for Intel CPU generation are enabled by default. If you have a processor that is older than generation, you may wish to run before the build. This command provides the best possible optimizations for your current CPU generation, but it may cause the built library to be incompatible with older generations. **Warning:** In low-memory or many-cpu environments, the bazel scheduler can miss the resource consumption estimates and the build may be terminated by the out-of-memory killer

. If that is your case, consider adding resource limit parameters to CMake, e. , 4) (Optional) Free disk space Usage 1) Write your C++ code: 2) Link TensorflowCC to your program using CMake 3) Build and run your program If you are still unsure, consult the Dockerfiles for Ubuntu and Arch Linux.

Frequently asked questions

How many stars and forks are recorded?

FloopCZ/tensorflow_cc has 762 stars and 179 forks.

What is the repository rank?

FloopCZ/tensorflow_cc is ranked 14,094.

What language and category are recorded?

FloopCZ/tensorflow_cc has 762 stars, uses Shell and belongs to Model Development.

Which repository is closest in rank?

FloopCZ/tensorflow_cc is compared with yingkaisha/keras-unet-collection, ranked 14,090 with 763 stars.

README

tensorflow_cc

This repository makes possible the usage of the TensorFlow C++ API from the outside of the TensorFlow source code folders and without the use of the Bazel build system.

This repository contains two CMake projects. The tensorflow_cc project downloads, builds and installs the TensorFlow C++ API into the operating system and the example project demonstrates its simple usage.

Docker

If you wish to start using this project right away, fetch a prebuilt image on Docker Hub!

Running the image on CPU:

docker run -it floopcz/tensorflow_cc:ubuntu /bin/bash

If you also want to utilize your NVIDIA GPU, install NVIDIA Docker and run:

docker run --gpus all -it floopcz/tensorflow_cc:ubuntu-cuda /bin/bash

The list of available images:

Image name Description
floopcz/tensorflow_cc:ubuntu Ubuntu build of tensorflow_cc
floopcz/tensorflow_cc:ubuntu-cuda Ubuntu build of tensorflow_cc + NVIDIA CUDA
floopcz/tensorflow_cc:archlinux Arch Linux build of tensorflow_cc
floopcz/tensorflow_cc:archlinux-cuda Arch Linux build of tensorflow_cc + NVIDIA CUDA

To build one of the images yourself, e.g. ubuntu, run:

docker build -t floopcz/tensorflow_cc:ubuntu -f Dockerfiles/ubuntu .

Installation

1) Install requirements

Ubuntu 18.04:

Install repository requirements:

sudo apt-get install cmake curl g++-7 git python3-dev python3-numpy sudo wget

Set up Python 3 to be the default Python:

update-alternatives --install /usr/bin/python python /usr/bin/python3 1

In order to build the TensorFlow itself, the build procedure also requires Bazel:

curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
sudo apt-get update && sudo apt-get install bazel

If you require GPU support on Ubuntu, please also install NVIDIA CUDA Toolkit (>=11.1), NVIDIA drivers, cuDNN, and cuda-command-line-tools package. The build procedure will automatically detect CUDA if it is installed in /opt/cuda or /usr/local/cuda directories.

Arch Linux:
sudo pacman -S base-devel bazel cmake git python python-numpy wget

For GPU support on Arch, also install the following:

sudo pacman -S cuda cudnn nvidia

Warning: Newer versions of TensorFlow sometimes fail to build with the latest version of Bazel. You may wish to install an older version of Bazel (e.g., 5.1.1).

Warning: If your program uses Protobuf and you encounter linkage or other problems, you can try -DINSTALL_PROTOBUF=ON option to install a Protobuf version matching the version bundled with TensorFlow. Our Dockerfiles are already built with the right version of Protobuf, so you may want to try your program in the Dockerfile first.

2) Clone this repository

git clone https://github.com/FloopCZ/tensorflow_cc.git
cd tensorflow_cc

3) Build and install the library

cd tensorflow_cc
mkdir build && cd build
cmake ..
make
sudo make install
sudo ldconfig

Warning: Optimizations for Intel CPU generation >=haswell are enabled by default. If you have a processor that is older than haswell generation, you may wish to run export CC_OPT_FLAGS="-march=native" before the build. This command provides the best possible optimizations for your current CPU generation, but it may cause the built library to be incompatible with older generations.

Warning: In low-memory or many-cpu environments, the bazel scheduler can miss the resource consumption estimates and the build may be terminated by the out-of-memory killer. If that is your case, consider adding resource limit parameters to CMake, e.g., cmake -DLOCAL_RAM_RESOURCES=2048 -DLOCAL_CPU_RESOURCES=4 ..

4) (Optional) Free disk space

# cleanup bazel build directory
rm -rf ~/.cache
# remove the build folder
cd .. && rm -rf build

Usage

1) Write your C++ code:

// example.cpp

#include 
#include 
#include 
using namespace std;
using namespace tensorflow;

int main()
{
    Session* session;
    Status status = NewSession(SessionOptions(), &session);
    if (!status.ok()) {
        cout << status.ToString() << "\n";
        return 1;
    }
    cout << "Session successfully created.\n";
}

2) Link TensorflowCC to your program using CMake

# CMakeLists.txt

find_package(TensorflowCC REQUIRED)
add_executable(example example.cpp)

# Link the Tensorflow library.
target_link_libraries(example TensorflowCC::TensorflowCC)

# You may also link cuda if it is available.
# find_package(CUDA)
# if(CUDA_FOUND)
#   target_link_libraries(example ${CUDA_LIBRARIES})
# endif()

3) Build and run your program

mkdir build && cd build
cmake .. && make
./example 

If you are still unsure, consult the Dockerfiles for Ubuntu and Arch Linux.

Nearby in the ranking
Similar items