# amir-abdi/keras_to_tensorflow

General code to convert a trained keras model into an inference tensorflow model

Repository: https://github.com/amir-abdi/keras_to_tensorflow
Canonical: https://ross.abutalabs.com/products/keras_to_tensorflow
Language: Python
License: MIT
License Family: permissive
Topics: machine-learning, deep-learning, keras, tensorflow, python
Last push: 2020-11-23T20:22:56+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3402, "days_push": 2109, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1646, forks 524 (observed 2026-08-28T04:05:16.301636+00:00)

## What it is
A Python CLI tool that converts trained Keras models (.h5 or .h5 + .) into frozen, inference-ready TensorFlow protobuf (.pb) files. It freezes variables to constants, prunes unused nodes, and optionally exports checkpoint/metagraph files.

## Use cases
- convert keras h5 model to tensorflow pb file
- freeze keras model for inference
- export keras model as tensorflow protobuf
- deploy keras model in tensorflow without keras dependency
- rename output tensors of a keras model
- convert keras model weights and  architecture to tf graph

## When to choose
- you have a trained Keras (TF 1.x era) model and need a standalone frozen TensorFlow graph for inference
- you want to strip Keras dependencies from a deployed model
- you need node pruning and variable freezing in a single .pb file

## When to avoid
- you are using TensorFlow 2.x with Keras and can use native SavedModel export instead
- you need continued training rather than inference-only export
- you need actively maintained tooling for modern TF/Keras versions

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: machine-learning, deep-learning, serialization, developer-tools
- domain: machine-learning, deep-learning, developer-tools
- platform: python, cli, cross-platform
- tags: keras, tensorflow, model-conversion, model-freezing, inference, protobuf

## Member repositories
- amir-abdi/keras_to_tensorflow (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:16.301636+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:45:22.546154+00:00, confidence not recorded.
  - readme: https://github.com/amir-abdi/keras_to_tensorflow (fetched 2026-08-28T04:05:16.301636+00:00, sha dd1f57be1613)
- Data as of 2026-08-30T08:39:29.467469+00:00.
