Skip to content

Commit

Permalink
codeclean/graph graphviz (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
Superjomn authored Jan 12, 2018
1 parent 2b614d3 commit 1a928b6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions visualdl/server/visualDL
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,7 @@ def histogram():

@app.route('/data/plugin/graphs/graph')
def graph():
global graph_image_path
# TODO(ChunweiYan) need to add a config for whether have graph.

image_dir = os.path.join(options.logdir, "graphs")
if not os.path.isdir(image_dir):
os.mkdir(image_dir)
image_path = vdl_graph.draw_graph(options.model_pb, image_dir)
graph_image_path = image_path
print 'image_path', image_path
data = {'url': '/graphs/image'}
result = gen_result(0, "", data)
return Response(json.dumps(result), mimetype='application/json')
Expand All @@ -203,4 +195,10 @@ if __name__ == '__main__':
logger.error("should pass in logdir option")
sys.exit(-1)

# draw graph
image_dir = os.path.join(options.logdir, "graphs")
if not os.path.isdir(image_dir):
os.mkdir(image_dir)
graph_image_path = vdl_graph.draw_graph(options.model_pb, image_dir)

app.run(debug=False, host=options.host, port=options.port)

0 comments on commit 1a928b6

Please sign in to comment.