diff options
author | 2017-01-03 11:30:57 -0800 | |
---|---|---|
committer | 2017-01-03 11:43:17 -0800 | |
commit | 542e4dcb3a777fc7046742a1295ace6d6ba9b8f9 (patch) | |
tree | 4517536c068ffdb3a2b1f4833afa63be55dcb307 | |
parent | f73fe0ecb51f54b9172d434fc8455a6b5fc32520 (diff) |
tfdbg doc: emphasize the new required BUILD dependnecy
Change: 143466666
-rw-r--r-- | tensorflow/g3doc/how_tos/debugger/index.md | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tensorflow/g3doc/how_tos/debugger/index.md b/tensorflow/g3doc/how_tos/debugger/index.md index da14f66f09..f7ba3e5849 100644 --- a/tensorflow/g3doc/how_tos/debugger/index.md +++ b/tensorflow/g3doc/how_tos/debugger/index.md @@ -40,9 +40,11 @@ three lines of code, which wrap the Session object with a debugger wrapper when the `--debug` flag is provided: ```python -if FLAGS.debug: - sess = tf_debug.LocalCLIDebugWrapperSession(sess) - sess.add_tensor_filter("has_inf_or_nan", tf_debug.has_inf_or_nan) +# Let your BUILD target depend on "//tensorflow/python/debug:debug_py" +from tensorflow.python import debug as tf_debug + +sess = tf_debug.LocalCLIDebugWrapperSession(sess) +sess.add_tensor_filter("has_inf_or_nan", tf_debug.has_inf_or_nan) ``` This wrapper has the same interface as Session, so enabling debugging requires @@ -357,7 +359,8 @@ for more details. [tfprof](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/tfprof) and other profiling tools for TensorFlow. -**Q**: _How do I link tfdbg against my `Session` in Bazel?_ +**Q**: _How do I link tfdbg against my `Session` in Bazel? Why do I see an + error such as "ImportError: cannot import name debug"?_ **A**: In your BUILD rule, declare dependencies: `"//tensorflow:tensorflow_py"` and `"//tensorflow/python/debug:debug_py"`. |