Practical overview
When it fits
Use it when model training can remain in Keras/Python but prediction needs to run in a C++ application without linking that application against TensorFlow, and the model's layers and configuration are supported.
Who it is for
- C++ developers integrating inference from a Keras model into an application or pipeline.
- Teams building models in Keras/Python that want to run predictions in C++.
- Developers evaluating a smaller-footprint alternative to linking an application against TensorFlow.
Documented uses
- Convert a saved Keras model into Frugally Deep's file format.
- Load the converted model from C++ and pass input tensors to its prediction function.
- Integrate supported sequential or functional-API model graphs into a C++ program.
Requirements & limits
- The model must use the TensorFlow backend and channels-last image data format.
- Layer support is broad but not universal; Lambda, text and spectrogram layers, stateful recurrent layers and temporal models are among the listed unsupported cases.
- The library depends on FunctionalPlus, Eigen and nlohmann/json, which are also header-only.
- Each prediction uses one CPU core and the library does not use a GPU; parallel predictions can use additional CPU cores.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Convert a Keras model for C++ inference
Prepare a Keras model file and load the converted model for prediction from C++.
Before you start
- A Keras model using the TensorFlow backend and channels-last image data format.
- Python/Keras for saving the model and running the conversion script.
- A C++ environment with Frugally Deep and its listed dependencies: FunctionalPlus, Eigen and nlohmann/json.
Steps
Build and train the model in Keras/Python, then save it as a .keras file.
Run the command below with the saved model file and a destination JSON filename.
python3 keras_export/convert_model.pyIn C++, include `
, load the JSON file withfdeep::load_model(...), and callmodel.predict(...)` with input tensors.
Expected outcome
A converted model can be loaded in C++ and used for a forward-pass prediction; loading also runs the generated comparison test case.
Guide limitations
- Only supported model layers and operations can be used; the README lists Lambda layers, several text and spectrogram layers, stateful recurrent layers and temporal models as unsupported.
- Models using a different image data format or a backend other than TensorFlow are not supported.
- Prediction uses one CPU core and does not use a GPU.
Compare options for Model inference and serving
These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.
| Project | Documented purpose | Platform | Access and requirements |
|---|---|---|---|
| Frugally Deep | Convert a saved Keras model into Frugally Deep's file format. | Linux, macOS, Self-hosted, Windows | |
| Hyperpose | Customize pose-estimation architectures and datasets. | Docker, Linux, macOS, Windows | |
| Multi Task Nlp | Define multiple tasks and their data and model settings in a YAML file. | Linux, macOS, Windows | The project is an open-source library under the Apache-2.0 license, distributed through its public GitHub repository. |
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- Dobiasd/frugally-deep · Official homepage title · retained in its source language

