Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. frugally-deep

frugally-deep

MITC++v0.20.0

A lightweight header-only C++ library for running Keras (TensorFlow) models without linking against TensorFlow.

GitHubGitHub
1.1k stars236 forks0 contributors

What is frugally-deep?

frugally-deep is a lightweight, header-only C++ library designed to run trained Keras models directly in C++ applications. It solves the problem of deploying machine learning models developed in Python/Keras into production C++ systems without requiring TensorFlow as a dependency. The library reimplements a subset of TensorFlow operations needed for prediction, resulting in smaller binary sizes and efficient CPU-based inference.

Target Audience

C++ developers and engineers who need to integrate pre-trained Keras models into performance-critical applications, embedded systems, or environments where Python or TensorFlow dependencies are undesirable.

Value Proposition

Developers choose frugally-deep for its minimal footprint, ease of integration, and ability to run Keras models in pure C++ without linking against TensorFlow. Its header-only nature and support for complex model architectures make it a versatile and efficient alternative for inference in resource-constrained scenarios.

Overview

A lightweight header-only library for using Keras (TensorFlow) models in C++.

Use Cases

Best For

  • Deploying Keras models in embedded systems with limited resources
  • Integrating neural networks into high-performance C++ applications
  • Reducing binary size by avoiding TensorFlow dependencies
  • Running inference on CPUs in multi-threaded C++ pipelines
  • Ensuring numerical consistency between Python training and C++ deployment
  • Using Keras models in environments where Python is not available

Not Ideal For

  • Applications requiring GPU acceleration for model inference
  • Projects using Keras models with unsupported layers like LSTM, GRU, or Conv3D
  • Teams needing strict compatibility with Python/TensorFlow versions outside the tested range
  • Real-time systems where single-threaded prediction latency is critical, as optimizations focus on throughput via parallelism

Pros & Cons

Pros

Header-Only Integration

As a header-only library, frugally-deep can be integrated into C++ projects without compiling external dependencies, simplifying build processes and reducing deployment overhead.

Broad Model Compatibility

It supports sequential models and complex computational graphs from Keras' functional API, including nested models and residual connections, making it versatile for various architectures beyond simple layers.

Minimal Dependency Footprint

Depends only on header-only libraries like Eigen and nlohmann/json, resulting in smaller binary sizes compared to linking against TensorFlow, ideal for resource-constrained or embedded systems.

Automated Model Verification

The conversion script generates and runs test cases to ensure numerical consistency between Keras and C++ predictions, reducing deployment risks and increasing confidence in model accuracy.

Cons

Limited Layer Support

Several key layer types, such as LSTM, GRU, and Conv3D, are not supported, restricting its use for models that rely on these advanced architectures, as noted in the README's 'Currently not supported' list.

CPU-Only Inference

The library ignores GPUs and uses only one CPU core per prediction, which can be a performance bottleneck for compute-intensive models that typically benefit from GPU acceleration, despite throughput gains via parallelism.

Version Sensitivity

Requires specific versions of Python, TensorFlow, and Keras (e.g., TensorFlow 2.18.0, Keras 3.8.0), which can complicate integration in environments with different or custom setups, potentially leading to compatibility issues.

Potential API Instability

The disclaimer explicitly states that the API might change in the future, posing a risk for long-term maintenance and production systems that rely on stable interfaces.

Frequently Asked Questions

Quick Stats

Stars1,127
Forks236
Contributors0
Open Issues0
Last commit2 months ago
CreatedSince 2016

Tags

#library#deep-learning#c-plus-plus-14#neural-networks#model-deployment#c-plus-plus#inference#keras#tensorflow#cpp14#convolutional-neural-networks#machine-learning#cpp#header-only

Built With

E
Eigen
J
JSON
C
C++14

Included in

C/C++70.6k
Auto-fetched 5 hours ago

Related Projects

Tensorflow - Open source software library for numerical computation using data flow graphsTensorflow - Open source software library for numerical computation using data flow graphs

An Open Source Machine Learning Framework for Everyone

Stars196,488
Forks75,509
Last commit4 hours ago
PyTorch - Tensors and Dynamic neural networks in Python with strong GPU accelerationPyTorch - Tensors and Dynamic neural networks in Python with strong GPU acceleration

Tensors and Dynamic neural networks in Python with strong GPU acceleration

Stars101,899
Forks28,473
Last commit4 hours ago
MXnet - Lightweight, Portable, Flexible Distributed/Mobile Deep Learning frameworkMXnet - Lightweight, Portable, Flexible Distributed/Mobile Deep Learning framework

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more

Stars20,820
Forks6,695
Last commit2 years ago
CNTK - Microsoft Cognitive ToolkitCNTK - Microsoft Cognitive Toolkit

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit

Stars17,600
Forks4,226
Last commit3 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub