diff options
author | 2017-09-06 20:54:01 -0700 | |
---|---|---|
committer | 2017-09-06 20:57:34 -0700 | |
commit | af41a029c8def570c409167326f59a5222452f40 (patch) | |
tree | 440f75dafd317b53df1390a66a8f30d281739cf4 /tensorflow/python/debug/lib | |
parent | 92570f8ff788aa7da86a4b4ca4f3596b84fb805f (diff) |
tfdbg: Fix python3 breakage in grpc debug tests caused by bytes-type plugin_data content
PiperOrigin-RevId: 167812508
Diffstat (limited to 'tensorflow/python/debug/lib')
-rw-r--r-- | tensorflow/python/debug/lib/grpc_debug_server.py | 4 | ||||
-rw-r--r-- | tensorflow/python/debug/lib/grpc_debug_test_server.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/tensorflow/python/debug/lib/grpc_debug_server.py b/tensorflow/python/debug/lib/grpc_debug_server.py index 28cf1514f6..64e4f00168 100644 --- a/tensorflow/python/debug/lib/grpc_debug_server.py +++ b/tensorflow/python/debug/lib/grpc_debug_server.py @@ -32,6 +32,7 @@ from tensorflow.core.framework import graph_pb2 from tensorflow.python.debug.lib import debug_graphs from tensorflow.python.debug.lib import debug_service_pb2_grpc from tensorflow.python.platform import tf_logging as logging +from tensorflow.python.util import compat DebugWatch = collections.namedtuple("DebugWatch", ["node_name", "output_slot", "debug_op"]) @@ -219,7 +220,8 @@ class EventListenerBaseServicer(debug_service_pb2_grpc.EventListenerServicer): """ value = event.summary.value[0] - debugger_plugin_metadata = json.loads(value.metadata.plugin_data.content) + debugger_plugin_metadata = json.loads( + compat.as_text(value.metadata.plugin_data.content)) device_name = debugger_plugin_metadata["device"] num_chunks = debugger_plugin_metadata["numChunks"] chunk_index = debugger_plugin_metadata["chunkIndex"] diff --git a/tensorflow/python/debug/lib/grpc_debug_test_server.py b/tensorflow/python/debug/lib/grpc_debug_test_server.py index 5e3743d9d3..2a87d861d2 100644 --- a/tensorflow/python/debug/lib/grpc_debug_test_server.py +++ b/tensorflow/python/debug/lib/grpc_debug_test_server.py @@ -41,6 +41,7 @@ from tensorflow.python.debug.lib import grpc_debug_server from tensorflow.python.framework import constant_op from tensorflow.python.framework import errors from tensorflow.python.ops import variables +from tensorflow.python.util import compat def _get_dump_file_path(dump_root, device_name, debug_node_name): @@ -198,7 +199,7 @@ class EventListenerTestStreamHandler( if not summary_metadata.plugin_data: raise ValueError("The value lacks plugin data.") try: - content = json.loads(summary_metadata.plugin_data.content) + content = json.loads(compat.as_text(summary_metadata.plugin_data.content)) except ValueError as err: raise ValueError("Could not parse content into JSON: %r, %r" % (content, err)) |