diff options
author | 2018-08-30 13:52:14 -0700 | |
---|---|---|
committer | 2018-08-30 13:56:48 -0700 | |
commit | f207dd8964be31ee33e733367f1c9b7325479482 (patch) | |
tree | 72f4ed849e25a757ecd22c8676fa955de1794d63 /tensorflow/python/debug | |
parent | 36a27b54060bc345b7fe28133912bee7e6fe3191 (diff) |
tfdbg: fix a bug in the example debug_tflearn_iris
Previously, if neither the --debug or --tensorboard_debug_address flag is used, the example will error out because the variable debug_hook is unset.
PiperOrigin-RevId: 210973500
Diffstat (limited to 'tensorflow/python/debug')
-rw-r--r-- | tensorflow/python/debug/examples/debug_tflearn_iris.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tensorflow/python/debug/examples/debug_tflearn_iris.py b/tensorflow/python/debug/examples/debug_tflearn_iris.py index 7cbaae46b4..019f13c450 100644 --- a/tensorflow/python/debug/examples/debug_tflearn_iris.py +++ b/tensorflow/python/debug/examples/debug_tflearn_iris.py @@ -113,17 +113,16 @@ def main(_): n_classes=3, model_dir=model_dir) - hooks = None if FLAGS.debug and FLAGS.tensorboard_debug_address: raise ValueError( "The --debug and --tensorboard_debug_address flags are mutually " "exclusive.") + hooks = [] if FLAGS.debug: - debug_hook = tf_debug.LocalCLIDebugHook(ui_type=FLAGS.ui_type, - dump_root=FLAGS.dump_root) + hooks.append(tf_debug.LocalCLIDebugHook(ui_type=FLAGS.ui_type, + dump_root=FLAGS.dump_root)) elif FLAGS.tensorboard_debug_address: - debug_hook = tf_debug.TensorBoardDebugHook(FLAGS.tensorboard_debug_address) - hooks = [debug_hook] + hooks.append(tf_debug.TensorBoardDebugHook(FLAGS.tensorboard_debug_address)) # Train model, using tfdbg hook. classifier.train(training_input_fn, |