txsun1997 / CoLAKE

COLING'2020: CoLAKE: Contextualized Language and Knowledge Embedding
https://aclanthology.org/2020.coling-main.327/
MIT License
114 stars 17 forks source link

运行run_pretrain.sh 时报错 KeyError: 'adj' #8

Closed xiyaAZ closed 3 years ago

xiyaAZ commented 3 years ago

Traceback (most recent call last): File "/home/ktfp768/CoLAKE/pretrain/run_pretrain.py", line 266, in train() File "/home/ktfp768/CoLAKE/pretrain/run_pretrain.py", line 146, in train test_data = FewRelDevDataSet(path=args.test_data, label_vocab=rel_vocab, ent_vocab=ent_vocab) File "../pretrain/dataset.py", line 528, in init 'attention_mask': ins['adj'], KeyError: 'adj' Traceback (most recent call last): File "/opt/scp/software/Python/3.6.3-foss-2017a/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/opt/scp/software/Python/3.6.3-foss-2017a/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/ktfp768/test/lib/python3.6/site-packages/torch/distributed/launch.py", line 260, in main() File "/home/ktfp768/test/lib/python3.6/site-packages/torch/distributed/launch.py", line 256, in main cmd=cmd) subprocess.CalledProcessError: Command '['/home/ktfp768/test/bin/python', '-u', '/home/ktfp768/CoLAKE/pretrain/run_pretrain.py', '--local_rank=0', '--name', 'CoLAKE', '--data_prop', '1.0', '--batch_size', '2048', '--lr', '1e-4', '--ent_lr', '1e-4', '--epoch', '1', '--grad_accumulation', '16', '--save_model', '--emb_name', 'entity_emb', '--n_negs', '200', '--beta', '0.98']' returned non-zero exit status 1.

txsun1997 commented 3 years ago

已修改--test_data默认为None. 如果需要在pretrain阶段也在FewRel上测试,可以把./finetune/dataloader.py里的REGraphDataSet迁移过来替换FewRelDevDataSet.