diff options
author | Shanqing Cai <cais@google.com> | 2017-03-01 19:28:17 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-03-01 19:44:15 -0800 |
commit | 2520eaea326adaff65d5cdd14748ed68bf6d8d75 (patch) | |
tree | e5b7223053740e4f5fd3e9a2e17f58f723849369 /tensorflow/python/debug/lib | |
parent | 38c9f4664eb53472448523da5e9d6c071e25c3fa (diff) |
tfdbg: fix source_utils on Windows
Use os.path.normpath to normalize backslashes in paths to forward slash before comparing paths.
Change: 148960384
Diffstat (limited to 'tensorflow/python/debug/lib')
-rw-r--r-- | tensorflow/python/debug/lib/source_utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tensorflow/python/debug/lib/source_utils.py b/tensorflow/python/debug/lib/source_utils.py index 9149c0b60b..cc949932cb 100644 --- a/tensorflow/python/debug/lib/source_utils.py +++ b/tensorflow/python/debug/lib/source_utils.py @@ -18,6 +18,8 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function +import os + def _convert_watch_key_to_tensor_name(watch_key): return watch_key[:watch_key.rfind(":")] @@ -59,6 +61,8 @@ def annotate_source(dump, raise ValueError("Cannot perform source annotation due to a lack of set " "Python graph in the dump object") + source_file_path = os.path.normpath(source_file_path) + line_to_op_names = {} for op in py_graph.get_operations(): try: @@ -71,7 +75,7 @@ def annotate_source(dump, max_line is not None and line_number >= max_line): continue - if file_path != source_file_path: + if os.path.normpath(file_path) != source_file_path: continue if do_dumped_tensors: |