Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init graph debug #8026

Merged
merged 7 commits into from
Feb 2, 2018
Merged

Conversation

Superjomn
Copy link
Contributor

@Superjomn Superjomn commented Feb 1, 2018

  • draw a graph for Block (due to loacl scope, only block(0) is supported)
  • highlights some symbols using regex.
import paddle.v2.fluid.debuger as debuger

debuger.draw_block_graphviz(framework.default_main_program().block(0),
                            highlights=["learning_rate*"])

image

@@ -1123,3 +1122,59 @@ def program_guard(main_program, startup_program=None):
switch_main_program(main_program)
if startup_program is not None:
switch_startup_program(startup_program)


def debug_block_image(block, highlights=[], path="./temp.dot"):
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to move this function to an independent file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fluid.debuger ?

Copy link
Member

Choose a reason for hiding this comment

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

cool, I think that is ok.

import proto.framework_pb2 as framework_pb2


def draw_block_graphviz(block, highlights=[], path="./temp.dot"):
Copy link
Member

Choose a reason for hiding this comment

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

do not use collections as default value

@jacquesqiao
Copy link
Member

I think we can have a directory called debugger, and put all the related file into this directory~

Copy link
Member

@jacquesqiao jacquesqiao left a comment

Choose a reason for hiding this comment

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

LGTM

@Superjomn Superjomn merged commit 8894c67 into PaddlePaddle:develop Feb 2, 2018
@Superjomn Superjomn deleted the feature/add_graph_debug branch February 2, 2018 03:35
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