BangLiu / ArticlePairMatching

The code of ACL 2019 paper: Matching Article Pairs with Graphical Decomposition and Convolutions
Other
234 stars 60 forks source link

File "/home/username/ArticlePairMatching/src/models/CCIG/data/ccig.py", line 30, in draw_ccig pos = gt.sfdp_layout(g) AttributeError: module 'graph_tool' has no attribute 'sfdp_layout' #21

Closed rashibudati closed 4 years ago

rashibudati commented 4 years ago

I have changed this

pos = sfdp_layout(g)
 graph_draw(g, pos=pos,
           vertex_text=g.vertex_properties["name"],
           vertex_fill_color=c,
           vertex_font_family="STKaiti",
           vertex_font_size=18,
           edge_font_family="STKaiti",
           edge_font_size=10,
           edge_text=g.edge_properties["name"],
           output_size=(1000, 1000),
           output=fig_name)

to this

pos = gt.sfdp_layout(g)
gt.graph_draw(g, pos=pos,
           vertex_text=g.vertex_properties["name"],
           vertex_fill_color=c,
           vertex_font_family="STKaiti",
           vertex_font_size=18,
           edge_font_family="STKaiti",
           edge_font_size=10,
           edge_text=g.edge_properties["name"],
           output_size=(1000, 1000),
           output=fig_name)

Even though I have everything imported from graph_tool, I face this error. I also imported graph_tool as gt. Kindly help me with this

rashibudati commented 4 years ago

Solved it! Turns out I have to put the definitions of the sfdp_layout (taken from it's source code). If there is any other solution please tell me. Also, does the concept graph generation take a lot of time? It's been running for about 5 hours and its still executing.

SCAUapc commented 4 years ago

Solved it! Turns out I have to put the definitions of the sfdp_layout (taken from it's source code). If there is any other solution please tell me. Also, does the concept graph generation take a lot of time? It's been running for about 5 hours and its still executing.

Hi, I sloved this problem by adding a line "from graph_tool.draw import * " it works for me .

rashibudati commented 4 years ago

Thanks @SCAUapc .