From 1740c0c37088deff392c041d9468c5669772ac3e Mon Sep 17 00:00:00 2001 From: Amir Abbasinejad Date: Fri, 27 Mar 2020 00:47:02 +0100 Subject: [PATCH] Update utils.py --- graphsage/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))