Keras 3 & Backend Modernization

A road out of legacy tf.keras, without a rewrite.

A lot of production deep-learning code is TF1.x-era or early tf.keras: it still trains, nobody wants to touch it, and every new hire needs a week to learn its quirks. Keras 3 gives that code a future — one API running on TensorFlow, JAX, or PyTorch — but the migration has sharp edges we know well.

What a modernization covers

  • Inventory and plan. We catalogue custom layers, losses, metrics, callbacks, Lambda layers, keras.backend usage, and custom training loops — the places migrations actually break — and produce a step-by-step plan with checkpoints.
  • The port. Model code moves to backend-agnostic keras.ops, serialization is re-established in the native .keras format with round-trip tests, and custom training steps are rewritten where the target backend requires it.
  • Backend strategy. TensorFlow, JAX, or PyTorch — chosen per workload on measured grounds, not fashion. Input pipelines built on tf.data carry over on every backend.
  • Performance. Mixed precision on tensor-core GPUs, distribution strategies for multi-device training, and input-pipeline tuning, each adopted against a fixed-seed baseline comparison.

Verification discipline

A migration is only done when the new stack reproduces the old one: same data, same seeds, matching loss curves and evaluation metrics within stated tolerances. We build that comparison harness first and keep it running throughout, so regressions are caught the day they appear.

Modernization work is hourly, and pairs well with your own engineers — the migration is also the best training course on the new stack your team will get.

Ask for a migration inventory and plan.
Still on TF1.x or old tf.keras?