diff options
Diffstat (limited to 'tensorflow/docs_src/programmers_guide/debugger.md')
-rw-r--r-- | tensorflow/docs_src/programmers_guide/debugger.md | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/tensorflow/docs_src/programmers_guide/debugger.md b/tensorflow/docs_src/programmers_guide/debugger.md index 87d900eae3..dd5496b08e 100644 --- a/tensorflow/docs_src/programmers_guide/debugger.md +++ b/tensorflow/docs_src/programmers_guide/debugger.md @@ -157,6 +157,7 @@ Try the following commands at the `tfdbg>` prompt (referencing the code at | | `pt <tensor>[slicing]` | Print a subarray of tensor, using [numpy](http://www.numpy.org/)-style array slicing. | `pt hidden/Relu:0[0:50,:]` | | | `-a` | Print the entirety of a large tensor, without using ellipses. (May take a long time for large tensors.) | `pt -a hidden/Relu:0[0:50,:]` | | | `-r <range>` | Highlight elements falling into specified numerical range. Multiple ranges can be used in conjunction. | `pt hidden/Relu:0 -a -r [[-inf,-1],[1,inf]]` | +| | `-n <number>` | Print dump corresponding to specified 0-based dump number. Required for tensors with multiple dumps. | `pt -n 0 hidden/Relu:0` | | | `-s` | Include a summary of the numeric values of the tensor (applicable only to non-empty tensors with Boolean and numeric types such as `int*` and `float*`.) | `pt -s hidden/Relu:0[0:50,:]` | | **`@[coordinates]`** | | Navigate to specified element in `pt` output. | `@[10,0]` or `@10,0` | | **`/regex`** | | [less](https://linux.die.net/man/1/less)-style search for given regular expression. | `/inf` | @@ -174,10 +175,12 @@ Try the following commands at the `tfdbg>` prompt (referencing the code at | | `-r` | List the inputs to node, recursively (the input tree.) | `li -r hidden/Relu:0` | | | `-d <max_depth>` | Limit recursion depth under the `-r` mode. | `li -r -d 3 hidden/Relu:0` | | | `-c` | Include control inputs. | `li -c -r hidden/Relu:0` | +| | `-t` | Show op types of input nodes. | `li -t -r hidden/Relu:0` | | **`lo`** | | **List output recipients of node** | | | | `-r` | List the output recipients of node, recursively (the output tree.) | `lo -r hidden/Relu:0` | | | `-d <max_depth>` | Limit recursion depth under the `-r` mode. | `lo -r -d 3 hidden/Relu:0` | | | `-c` | Include recipients via control edges. | `lo -c -r hidden/Relu:0` | +| | `-t` | Show op types of recipient nodes. | `lo -t -r hidden/Relu:0` | | **`ls`** | | **List Python source files involved in node creation.** | | | | `-p <path_pattern>` | Limit output to source files matching given regular-expression path pattern. | `ls -p .*debug_mnist.*` | | | `-n` | Limit output to node names matching given regular-expression pattern. | `ls -n Softmax.*` | @@ -517,12 +520,8 @@ model.fit(...) # This will break into the TFDBG CLI. ## Debugging tf-slim with TFDBG -TFDBG supports debugging of training and evaluation with +TFDBG currently supports only training with [tf-slim](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/slim). -As detailed below, training and evaluation require slightly different debugging -workflows. - -### Debugging training in tf-slim To debug the training process, provide `LocalCLIDebugWrapperSession` to the `session_wrapper` argument of `slim.learning.train()`. For example: @@ -531,31 +530,13 @@ import tensorflow as tf from tensorflow.python import debug as tf_debug # ... Code that creates the graph and the train_op ... -tf.contrib.slim.learning.train( +tf.contrib.slim.learning_train( train_op, logdir, number_of_steps=10, session_wrapper=tf_debug.LocalCLIDebugWrapperSession) ``` -### Debugging evaluation in tf-slim -To debug the evaluation process, provide `LocalCLIDebugHook` to the -`hooks` argument of `slim.evaluation.evaluate_once()`. For example: - -``` python -import tensorflow as tf -from tensorflow.python import debug as tf_debug - -# ... Code that creates the graph and the eval and final ops ... -tf.contrib.slim.evaluation.evaluate_once( - '', - checkpoint_path, - logdir, - eval_op=my_eval_op, - final_op=my_value_op, - hooks=[tf_debug.LocalCLIDebugHook()]) -``` - ## Offline Debugging of Remotely-Running Sessions Often, your model is running on a remote machine or a process that you don't |