tensorflow_cc  by FloopCZ

C++ API for TensorFlow, built outside TensorFlow source

created 8 years ago
765 stars

Top 45.6% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This repository provides a build system for the TensorFlow C++ API, enabling its use outside the TensorFlow source tree and without Bazel. It targets C++ developers needing to integrate TensorFlow's machine learning capabilities into their applications, offering a simplified build and installation process.

How It Works

The project utilizes CMake to download, build, and install the TensorFlow C++ API. It manages dependencies and configurations, abstracting away the complexities of TensorFlow's native Bazel build system. This approach simplifies the build process and allows for easier integration into existing C++ projects.

Quick Start & Requirements

  • Docker: Pre-built images are available on Docker Hub for CPU (floopcz/tensorflow_cc:ubuntu) and GPU (floopcz/tensorflow_cc:ubuntu-cuda).
    • CPU: docker run -it floopcz/tensorflow_cc:ubuntu /bin/bash
    • GPU: docker run --gpus all -it floopcz/tensorflow_cc:ubuntu-cuda /bin/bash
  • Manual Build (Ubuntu): Requires cmake, curl, g++-7, git, python3-dev, python3-numpy, wget, and bazel. GPU support requires NVIDIA CUDA Toolkit (>=11.1), drivers, and cuDNN.
  • Manual Build (Arch Linux): Requires base-devel, bazel, cmake, git, python, python-numpy, wget. GPU support requires cuda, cudnn, nvidia.
  • Build Steps: Clone the repository, create a build directory, run cmake .., make, and sudo make install.
  • Resources: Building TensorFlow can be resource-intensive; consider CMake options like -DLOCAL_RAM_RESOURCES and -DLOCAL_CPU_RESOURCES for low-memory environments.
  • Documentation: Usage examples and Dockerfiles are provided.

Highlighted Details

  • Eliminates the need for Bazel for TensorFlow C++ API builds.
  • Provides pre-built Docker images for quick setup and GPU acceleration.
  • CMake-based build system simplifies integration into C++ projects.
  • Supports both CPU and NVIDIA GPU configurations.

Maintenance & Community

No specific contributors, sponsorships, or community links (Discord/Slack) are mentioned in the README.

Licensing & Compatibility

The repository's license is not explicitly stated in the README. Compatibility for commercial use or closed-source linking would depend on the underlying TensorFlow license and any additional licensing applied to this wrapper project.

Limitations & Caveats

Newer TensorFlow versions may fail to build with the latest Bazel; older Bazel versions might be necessary. Protobuf linkage issues can occur, potentially requiring the -DINSTALL_PROTOBUF=ON CMake option. CPU optimizations are enabled by default for Haswell and newer, which may cause incompatibility with older CPUs if CC_OPT_FLAGS="-march=native" is used.

Health Check
Last commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
1 stars in the last 30 days

Explore Similar Projects

Starred by Nat Friedman Nat Friedman(Former CEO of GitHub), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
10 more.

FasterTransformer by NVIDIA

0.1%
6k
Optimized transformer library for inference
created 4 years ago
updated 1 year ago
Starred by Peter Norvig Peter Norvig(Author of "Artificial Intelligence: A Modern Approach"; Research Director at Google), Aravind Srinivas Aravind Srinivas(Cofounder of Perplexity), and
72 more.

tensorflow by tensorflow

0.1%
191k
Open-source ML framework
created 9 years ago
updated 21 hours ago
Feedback? Help us improve.