Hi Tiago, I now get another error message: AttributeError: 'NestedBlockState' object has no attribute 'get_nonempty_B' Do you know what this is caused by? The MWE is: import graph_tool.all as gt import cPickle as pickle g = gt.load_graph('graph_no_multi_reac_type.gt') gt.remove_parallel_edges(g) state = gt.minimize_nested_blockmodel_dl(g, deg_corr=True) state = state.copy(sampling=True) with open('state_mcmc.pkl','wb') as state_pkl: pickle.dump(state,state_pkl,-1) print 'equilibrating Markov chain' gt.mcmc_equilibrate(state, wait=1000, mcmc_args=dict(niter=10)) h = np.zeros(g.num_vertices() + 1) def collect_num_groups(s): B = s.get_nonempty_B() h[B] += 1 print 'colleting marginals' gt.mcmc_equilibrate(state, force_niter=10000, mcmc_args=dict(niter=10), callback=collect_num_groups) The traceback I get is: Traceback (most recent call last): File "num_groups_marg_prob.py", line 42, in <module> gt.mcmc_equilibrate(state, force_niter=10000, mcmc_args=dict(niter=10), File "/usr/lib/python2.7/dist-packages/graph_tool/inference/mcmc.py", line 172, in mcmc_equilibrate extra = callback(state) File "num_groups_marg_prob.py", line 35, in collect_num_groups def collect_num_groups(s): AttributeError: 'NestedBlockState' object has no attribute 'get_nonempty_B' -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.