Relevant source material
TensorFlow Debugger Screencast - YouTube

I plan on building a mode for emacs that includes syntax highlighting and keyboard macros, but I’ll have to wait until tfdb is released for TF2.0.

Wrapping TensorFlow Sessions With tfdbg

Add the following lines of code to use tfdbg and then contain the Session object using a debugger wrapper.

from tensorflow.python import debug as tf_debug
  • CLI should be called before and after if you wish to take control of the execution and know the internal state of the graph.
  • Filters can be added for assisting the diagnosis.
    In the provided example, there is already a filter called tfdbg.has_inf_or_nan, which determine the presence of nan or inf in any in-between tensors, which are neither inputs nor outputs.
  • You may write your own custom filters.

Debugging TensorFlow Model Training with tfdbg

This only works for TensorFlow 1 at the moment.

Typical use-cases

  • finding NaNs
  • finding Infs (infinities)

ewwlinks +/"4. Debugging TensorFlow Model Training with tfdbg" ""

Both the conda-run and python3.7 scripts put me in the anaconda environment.

export TTY

( hs "$(basename "$0")" "$@" "#" "<==" "$(ps -o comm= $PPID)" 0</dev/null ) &>/dev/null

. $HOME/sh-source/conda-init

python3.7 -m tensorflow.python.debug.examples.debug_mnist –debug
conda-run python -m tensorflow.python.debug.examples.debug_mnist –debug

The tfdbg CLI does not appear in tensorflow 2.0.

TF Debugger (tfdbg) for TF v2.0 is still being designed and will be made available at a later time.

As you pointed out, tfdbg is originally designed for TF v1.x and is centered around the tf.Session API.

As tf.Session is replaced by eager execution and tf.functions in 2.0, the debugger feature needs to be adapted to the architectural change.

If you have a specific use case (e.g., finding Infinities and NaNs, or other debugging workflows), please let us know.

It’ll inform the design of the new version of tfdbg.