TensorFlow Debugger (tfdb) and emacs
- Relevant source material
- TensorFlow Debugger Screencast - YouTube
DebugTFBasics
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.
|
|
- CLI should be called before and after
Session.run()
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 calledtfdbg.has_inf_or_nan
, which determine the presence ofnan
orinf
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)
|
|
Both the conda-run
and python3.7
scripts put me in the anaconda
environment.
|
|
|
|
The tfdbg
CLI does not appear in tensorflow 2.0.
https://github.com/tensorflow/tensorflow/issues/29679
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.