I'm saving NestedState with pickle and then loading it later to use get_edges_prob.
nested_state = pickle.load( open(f"output/graphtool_output/pickle/{name}_nested_blockstate.p", "rb")) I realized that NestedState needs a reference to the underlying graph for get_edges_prob to work. So, I try this. G = gt.load_graph(f'output/graphtool_output/{name}.graphml') nested_state.g = G Now, get_edges_prob is working if I use the base level of the state, like so: def collect_edge_probs(s): s = s.levels[0] for i, non_edge in enumerate(non_edges): p = s.get_edges_prob([non_edge], [], entropy_args=dict(partition_dl=False)) non_edges_probs[i].append(p) If I remove this " s = s.levels[0]" I'm getting an error about "invalid edge descriptor". Is there some other reference I need to recover for this to work correctly? Any help appreciated!
_______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool