tensorflow_cc  by FloopCZ

C++ API for TensorFlow, built outside TensorFlow source

Created 8 years ago
766 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
0 stars in the last 30 days

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Anil Dash Anil Dash(Former CEO of Glitch), and
23 more.

llamafile by Mozilla-Ocho

0.1%
23k
Single-file LLM distribution and runtime via `llama.cpp` and Cosmopolitan Libc
Created 2 years ago
Updated 3 months ago
Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), and
26 more.

open-webui by open-webui

0.6%
113k
Self-hosted AI platform for local LLM deployment
Created 2 years ago
Updated 1 day 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
100 more.

tensorflow by tensorflow

0.1%
192k
Open-source ML framework
Created 10 years ago
Updated 21 hours ago
Feedback? Help us improve.