我在 tensorboard.py 和 tensorboard_handler.py 文件中清除了 python 2to3 的差异,但 Tensorboard 仍然存在可视化错误。
浏览器端错误:
图形可视化失败:错误:解析图形定义失败
服务器端错误日志是:
Exception happened during processing of request from ('127.0.0.1', 52783)
Traceback (most recent call last):
File "/usr/lib/python3.4/socketserver.py", line 617, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.4/socketserver.py", line 344, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.4/site-
packages/tensorflow/tensorboard/tensorboard_handler.py", line 85, in __ init __
http.server.BaseHTTPRequestHandler.__init__(self,*args)
File "/usr/lib/python3.4/socketserver.py", line 673, in __ init __
self.handle()
File "/usr/lib/python3.4/http/server.py", line 398, in handle
self.handle_one_request()
File "/usr/lib/python3.4/http/server.py", line 386, in handle_one_request
method()
File "/usr/lib/python3.4/site-
packages/tensorflow/tensorboard/tensorboard_handler.py", line 389, in do_GET
handlers[clean_path](query_params)
File "/usr/lib/python3.4/site-
packages/tensorflow/tensorboard/tensorboard_handler.py", line 217, in
_serve_graph
self._send_gzip_response(graph_pbtxt, 'text/plain')
File "/usr/lib/python3.4/site-
packages/tensorflow/tensorboard/tensorboard_handler.py", line 135, in
_send_gzip_response
f = gzip.GzipFile(fileobj=out, mode='w')
File "/usr/lib/python3.4/gzip.py", line 220, in __ init __
self._write_gzip_header()
File "/usr/lib/python3.4/gzip.py", line 252, in _write_gzip_header
self.fileobj.write(b'\037\213') # magic header
TypeError: string argument expected, got 'bytes'