diff --git a/graphsage/utils.py b/graphsage/utils.py index ff05072d..c3297397 100644 --- a/graphsage/utils.py +++ b/graphsage/utils.py @@ -82,7 +82,7 @@ def run_random_walks(G, nodes, num_walks=N_WALKS): for i in range(num_walks): curr_node = node for j in range(WALK_LEN): - next_node = random.choice(G.neighbors(curr_node)) + next_node = random.choice(list(G.neighbors(curr_node))) # self co-occurrences are useless if curr_node != node: pairs.append((node,curr_node))