Skip to content

Conversation

daming-lu
Copy link
Collaborator

  1. changed backend code to load JSON instead of static graph
  2. added checks so that we do not process bad graph data

TODO: add slider for large graph
We need this because if the graph is too large, each node is too small to see clearly. See MNIST vs. SqueezeNet below:

MNIST:
mnist_graph

SqueezeNet:
squeezenet_graph

return self.graph.edge(source, target, **kwargs)


def draw_graph(model_pb_path, image_dir):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name doesn't apply anymore. Also the we no longer need image_dir.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This will also be renamed in the cleanup PR.

data = {'url': ''}
# TODO(daming-lu): rename variables because we switched from static graph generated by graphviz
# to d3/dagre drawn svg
if graph_image_path is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we generate static image? We might be able to remove block

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the TODO mentioned, we need to rename and remove some stuff because we were using GraphViz previously. I will do it after the release

}
else:
data = {'url': '/graphs/image'}
image_dir = os.path.join(args.logdir, "graphs")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image_dir seems un-necessary now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It will be removed in the code cleanup.

@daming-lu daming-lu merged commit 6ff9620 into PaddlePaddle:develop Apr 12, 2018
@daming-lu daming-lu deleted the fix_graph_end2end branch April 18, 2018 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants