DreamInvoker / GAIN

Source code for EMNLP 2020 paper: Double Graph Based Reasoning for Document-level Relation Extraction
MIT License
142 stars 30 forks source link

Error in Training #3

Closed carlosrokk3r closed 3 years ago

carlosrokk3r commented 3 years ago

Hi! I'm trying to train the neural network, using the default values provided in the script run_GAIN_BERT.sh(I just changed the bert_path from ../PLM/bert-base-uncased to bert-base-uncased), but the training script is giving me an error after beginning. It seems to be an error with DGL The error is the following:

Traceback (most recent call last):
  File "train.py", line 231, in <module>
    train(opt)
  File "train.py", line 138, in train
    ht_pair_distance=d['ht_pair_distance']
  File "/Users/carlos.jimenez/PycharmProjects/GAIN/doc_processor/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/Users/carlos.jimenez/PycharmProjects/GAIN/code/models/GAIN.py", line 348, in forward
    graphs = dgl.unbatch_hetero(graph_big)
  File "/Users/carlos.jimenez/PycharmProjects/GAIN/doc_processor/lib/python3.7/site-packages/dgl/batch.py", line 418, in unbatch_hetero
    return batch(*args, **kwargs)
  File "/Users/carlos.jimenez/PycharmProjects/GAIN/doc_processor/lib/python3.7/site-packages/dgl/batch.py", line 167, in batch
    if any(g.is_block for g in graphs):
  File "/Users/carlos.jimenez/PycharmProjects/GAIN/doc_processor/lib/python3.7/site-packages/dgl/batch.py", line 167, in <genexpr>
    if any(g.is_block for g in graphs):
  File "/Users/carlos.jimenez/PycharmProjects/GAIN/doc_processor/lib/python3.7/site-packages/dgl/heterograph.py", line 1968, in __getitem__
    raise DGLError('Invalid key "{}". Must be one of the edge types.'.format(orig_key))
dgl._ffi.base.DGLError: Invalid key "0". Must be one of the edge types.

Could you please help me finding what is wrong?

DreamInvoker commented 3 years ago

The version of DGL greater or equal than 0.5 may cause this problem, please use 0.4.3 instead.