TmacMai / CoMPILE_Inductive_Knowledge_Graph

Communicative Message Passing for Inductive Relation Reasoning(AAAI-2021)
MIT License
30 stars 4 forks source link

一些bug及代码运行效率问题 #3

Open smart-lty opened 2 years ago

smart-lty commented 2 years ago

作者您好~我在跑代码时遇到了如下问题:

  1. 代码存在一些bug。 1.1 data_utils.py 第35行中,line.split(" ")会导致process_files函数报错,原因是train.txt中,实体和关系是用\t分割的,应该改为line.split()。 1.2 graph_classifier.py 第223行,会报错“RuntimeError: Expected object of scalar type Long but got scalar type Float for sequence element 1 in sequence argument at position #1 'tensors'”,在201及202行后均应添加".long()"。
  2. 代码的运行效率有些奇怪。 我在跑代码时,发现效率有些过于低了...使用tqdm查看一个epoch的运行情况,情况如下: image 可以看到一个epoch大概就需要40~50分钟,我使用的是一块2080TI显卡。请问是我运行的有问题吗?或者是运行的代码版本不太正确?

期待您的回复~

TmacMai commented 2 years ago

谢谢您指出的bug。您运行的是fb-v4数据集?那个数据集确实是会比较慢的,v1-v3应该快很多。另外,我为了图建模的灵活性,在写模型的时候没有用dgl,这可能会对效率有一点影响