node2vec_linkprediction icon indicating copy to clipboard operation
node2vec_linkprediction copied to clipboard

TypeError: 'int' object has no attribute '__getitem__'

Open zuozijiZHOULI opened this issue 6 years ago • 1 comments

Traceback (most recent call last): File "link_prediction.py", line 548, in test_edge_functions(args) File "link_prediction.py", line 322, in test_edge_functions Gtrain, Gtest = create_train_test_graphs(args) File "link_prediction.py", line 300, in create_train_test_graphs directed=args.directed) File "link_prediction.py", line 109, in read_graph G.edges[edge[0]][edge[1]]['weight'] = 1 TypeError: 'int' object has no attribute 'getitem'

zuozijiZHOULI avatar Oct 17 '18 14:10 zuozijiZHOULI

the error line is at G.edges[edge[0]][edge[1]]['weight'] = 1. Just convert it to G[edge[0]][edge[1]]['weight'] = 1

zpengc avatar Oct 26 '21 06:10 zpengc