← all repositories
ericjang/tdb

GDB for TensorFlow: debugging graphs node by node

A visual debugger that lets you set breakpoints inside a TensorFlow graph and step through execution like it's 1975.

1.3k stars JavaScript ML FrameworksLLMOps · Eval
tdb
Velocity · 7d
+0.4
★ / day
Trend
steady
star history

What it does TDB is a Python library plus Jupyter extension that wraps TensorFlow with interactive debugging. You set breakpoints on ops or tensors, pause execution, inspect values, and resume with tdb.c() or step forward with tdb.s(). It also streams live Matplotlib plots—histograms, loss curves, whatever you define—while the network trains.

The interesting bit The README’s own analogy is apt: TDB is to TensorBoard as GDB is to printf. Where TensorBoard requires you to finish a run and read logs, TDB hijacks the live graph execution and lets you inject arbitrary Python functions as first-class nodes. You can literally drop a Python myadd function between TensorFlow ops and it becomes part of the computational graph.

Key highlights

  • Breakpoints on individual ops/tensors with tdb.debug(), tdb.c(), tdb.s()
  • Real-time arbitrary Matplotlib plots via tdb.plot_op() without stopping training
  • User-defined Python ops that accept tf.Tensor inputs and output placeholders
  • Jupyter notebook extension for frontend visualization
  • Apache 2.0 licensed

Caveats

  • Explicitly unmaintained; the author points to official tfdbg as the successor
  • Plotting backend locked to Matplotlib; promised Seaborn/Bokeh/Plotly support never arrived
  • Setup requires manual zip download and notebook.nbextensions fiddling

Verdict Worth studying if you’re building debugging tools for ML frameworks, or if you’re stuck maintaining legacy TensorFlow 1.x code. Everyone else should use the official TensorFlow Debugger or modern equivalents.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.