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 #26

Open Luguo-ry opened 3 years ago

Luguo-ry 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, but the training script is giving me an error after beginning. It seems to be an error with DGL The error is the following: 捕获

Emir-Liu commented 3 years ago

when using the new version packet,I meet the problem too.And,I change the code in GAIN.py.

# graph_big = dgl.batch_hetero(graphs)
graph_big = dgl.batch_hetero(graphs).to('cuda:0')
...
# entity_graph_big = dgl.batch(entity_graphs)
entity_graph_big = dgl.batch(entity_graphs).to('cuda:0')
LawsonAbs commented 2 years ago

升级dgl库,然后改写对应代码,将模型放到GPU上就ok了

duLun008 commented 2 years ago

when using the new version packet,I meet the problem too.And,I change the code in GAIN.py.

# graph_big = dgl.batch_hetero(graphs)
graph_big = dgl.batch_hetero(graphs).to('cuda:0')
...
# entity_graph_big = dgl.batch(entity_graphs)
entity_graph_big = dgl.batch(entity_graphs).to('cuda:0')

useful, and dgl-cu102 (0.4.3) not suitable. I use 0.6.1 then it works