FighterLYL / GraphNeuralNetwork

《深入浅出图神经网络:GNN原理解析》配套代码
1.76k stars 462 forks source link

跑第七章的程序时出现问题?求助。 #25

Closed loovi7 closed 4 years ago

loovi7 commented 4 years ago

Traceback (most recent call last): File "main.py", line 71, in train() File "main.py", line 47, in train batch_sampling_result = multihop_sampling(batch_src_index, NUM_NEIGHBORS_LIST, data.adjacency_dict) File "E:\GraphNeuralNetwork-master\chapter7\sampling.py", line 37, in multihop_sampling hopk_result = sampling(sampling_result[k], hopk_num, neighbor_table) File "E:\GraphNeuralNetwork-master\chapter7\sampling.py", line 19, in sampling res = np.random.choice(neighbor_table[sid], size=(sample_num, )) TypeError: 'coo_matrix' object is not subscriptable

FighterLYL commented 4 years ago

你可能是直接使用了第5章生成的pkl文件,建议使用第7章的代码重新生成

loovi7 commented 4 years ago

你可能是直接使用了第5章生成的pkl文件,建议使用第7章的代码重新生成

谢谢!我再试试。感谢您的回复。