Skip to content

Commit b260fe4

Browse files
caisqtensorflower-gardener
authored andcommitted
Minor changes to debugger.md
PiperOrigin-RevId: 164342823
1 parent 3b857e2 commit b260fe4

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

programmers_guide/debugger.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,11 @@ Try the following commands at the `tfdbg>` prompt (referencing the code at
153153
| **`@[coordinates]`** | | Navigate to specified element in `pt` output. | `@[10,0]` or `@10,0` |
154154
| **`/regex`** | | [less](https://linux.die.net/man/1/less)-style search for given regular expression. | `/inf` |
155155
| **`/`** | | Scroll to the next line with matches to the searched regex (if any). | `/` |
156-
| **`pf`** | | **Print a value in the feed_dict to `Session.run` ** | |
156+
| **`pf`** | | **Print a value in the feed_dict to `Session.run`.** | |
157157
| | `pf <feed_tensor_name>` | Print the value of the feed. Also note that the `pf` command has the `-a`, `-r` and `-s` flags (not listed below), which have the same syntax and semantics as the identically-named flags of `pt`. | `pf input_xs:0` |
158+
| **eval** | | **Evaluate arbitrary Python and numpy expression.** | |
159+
| | `eval <expression>` | Evaluate a Python / numpy expression, with numpy available as `np` and debug tensor names enclosed in backticks. | ``eval "np.matmul((`output/Identity:0` / `Softmax:0`).T, `Softmax:0`)"`` |
160+
| | `-a` | Print a large-sized evaluation result in its entirety, i.e., without using ellipses. | ``eval -a 'np.sum(`Softmax:0`, axis=1)'`` |
158161
| **`ni`** | | **Display node information.** | |
159162
| | `-a` | Include node attributes in the output. | `ni -a hidden/Relu` |
160163
| | `-d` | List the debug dumps available from the node. | `ni -d hidden/Relu` |
@@ -182,6 +185,7 @@ Try the following commands at the `tfdbg>` prompt (referencing the code at
182185
| | `--node_name_filter <pattern>` | Execute the next `Session.run`, watching only nodes with names matching the given regular-expression pattern. | `run --node_name_filter Softmax.*` |
183186
| | `--op_type_filter <pattern>` | Execute the next `Session.run`, watching only nodes with op types matching the given regular-expression pattern. | `run --op_type_filter Variable.*` |
184187
| | `--tensor_dtype_filter <pattern>` | Execute the next `Session.run`, dumping only Tensors with data types (`dtype`s) matching the given regular-expression pattern. | `run --tensor_dtype_filter int.*` |
188+
| | `-p` | Execute the next `Session.run` call in profiling mode. | `run -p` |
185189
| **`ri`** | | **Display information about the run the current run, including fetches and feeds.** | `ri` |
186190
| **`help`** | | **Print general help information** | `help` |
187191
| | `help <command>` | Print help for given command. | `help lt` |
@@ -204,16 +208,6 @@ addditional features:
204208
* Use the `prev` and `next` commands.
205209
* Click underlined `<--` and `-->` links near the top left corner of the
206210
screen.
207-
* Evaluation of arbitrary expressions (with `numpy` imported as `np`) using
208-
debug tensor names enclosed in pairs of backtics. Use the `-a` flag to
209-
print large-sized results in its entirety. For example:
210-
211-
```none
212-
tfdbg> eval np.argmax(`Softmax:0`)
213-
tfdbg> eval "np.matmul((`output/Identity:0` / `Softmax:0`).T, `Softmax:0`)"
214-
tfdbg> eval -a 'np.sum(`Softmax:0`, axis=1)'
215-
```
216-
217211
* Tab completion of commands and some command arguments.
218212
* To redirect the screen output to a file instead of the screen, end the
219213
command with bash-style redirection. For example, the following command
@@ -612,8 +606,10 @@ python -m tensorflow.python.debug.cli.offline_analyzer \
612606
graph to record the values of intermediate tensors. These nodes
613607
slow down the graph execution. If you are interested in profiling your
614608
model, check out
615-
[tfprof](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/profiler)
616-
and other profiling tools for TensorFlow.
609+
610+
1. The profiling mode of tfdbg: `tfdbg> run -p`.
611+
2. [tfprof](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/profiler)
612+
and other profiling tools for TensorFlow.
617613
618614
**Q**: _How do I link tfdbg against my `Session` in Bazel? Why do I see an
619615
error such as "ImportError: cannot import name debug"?_

0 commit comments

Comments
 (0)