BUPT-GAMMA / CompareNet_FakeNewsDetection

Compare to The Knowledge: Graph Neural Fake News Detection with External Knowledge (ACL 2021)
89 stars 35 forks source link

Lost of file when running testing code #2

Closed chenhz12 closed 2 years ago

chenhz12 commented 2 years ago

Hi, I'm chenhz12.

I am trying to reproduce your result and I met some problem. When I run the test code, it seems you don't provide pre-trained model. Because I didn't notice this file in directory structure. Testing issue

Thank you for fixing this issue.

ytc272098215 commented 2 years ago

Hi, I'm chenhz12.

I am trying to reproduce your result and I met some problem. When I run the test code, it seems you don't provide pre-trained model. Because I didn't notice this file in directory structure. Testing issue

Thank you for fixing this issue.

This error seems to be caused by the omission of saving the w2i dict during training (mode=0) in the file data_loader.py. This intention was to avoid repetitive loading of the training set to improve efficiency, but unfortunately the code failed to be carefully polished. I think this error can be fixed by adding the following codes in data_loader.py in line 88:

if params.mode == 0:
    with open(w2i_pkl_path, 'wb') as f:
        w2i = pkl.dump(w2i, f)

or deleting line 60-62 and copying line 50-55 here.

chenhz12 commented 2 years ago

Thank you for your reply. I have tried the two solution you mentioned. The first one didn't fix the problem and the second way works. Could you provide me the pre-trained model which can reproduce the result in the paper?

ytc272098215 commented 2 years ago

Thank you for your reply. I have tried the two solution you mentioned. The first one didn't fix the problem and the second way works. Could you provide me the pre-trained model which can reproduce the result in the paper?

We did not keep the model ckpt, you can obtain it through training first.

chenhz12 commented 2 years ago

image

During the training process, even if I already set GPU ID, it still can't run and keep reporting "to_gpu() missing 1 required positional argument: 'cuda'"

chenhz12 commented 2 years ago

It seems that "arr.cuda" is need in line 34 instead of "cuda" in util.py image

ytc272098215 commented 2 years ago

Plz try to modify line 37 to return [self.to_gpu(a, cuda) for a in arr]

image

During the training process, even if I already set GPU ID, it still can't run and keep reporting "to_gpu() missing 1 required positional argument: 'cuda'"

chenhz12 commented 2 years ago

Plz try to modify line 37 to return [self.to_gpu(a, cuda) for a in arr]

image During the training process, even if I already set GPU ID, it still can't run and keep reporting "to_gpu() missing 1 required positional argument: 'cuda'"

Thank you for your reply, I can finally start training now. But the same issue as https://github.com/BUPT-GAMMA/CompareNet_FakeNewsDetection/issues/3 occurs. image

This issue doesn't just come to me. So I think the reason may be in the code. Would you kindly check the code again? Thank you very much.

ytc272098215 commented 2 years ago

Plz try to modify line 37 to return [self.to_gpu(a, cuda) for a in arr]

image During the training process, even if I already set GPU ID, it still can't run and keep reporting "to_gpu() missing 1 required positional argument: 'cuda'"

Thank you for your reply, I can finally start training now. But the same issue as #3 occurs. image

This issue doesn't just come to me. So I think the reason may be in the code. Would you kindly check the code again? Thank you very much.

It seems that this error was caused by the change of the data link that I rely on. I have found the data in my local machine and uploaded it to the release(raw_data.zip). Please check if the error still occurs. https://github.com/BUPT-GAMMA/CompareNet_FakeNewsDetection/releases/tag/dataset

chenhz12 commented 2 years ago

image It finally works!! Thank you very much!!