Alibaba-NLP / ACE

[ACL-IJCNLP 2021] Automated Concatenation of Embeddings for Structured Prediction
Other
296 stars 44 forks source link

KeyError: "Unable to open object (object 'conll_03_english_train_-1' doesn't exist)" #33

Closed gly99999 closed 2 years ago

gly99999 commented 2 years ago

你好啊,我执行这个命令CUDA_VISIBLE_DEVICES=0 python train.py --config config/doc_ner_best.yaml --test的时候出现的问题,我也把这个出问题的文件路径打印出来,就是这个/home/gly/download/bert-large-cased.hdf5,这个conll_03_englishtrain-1需要吗

[2022-04-14 21:58:45,188 INFO] loading weights file https://cdn.huggingface.co/bert-base-multilingual-cased-pytorch_model.bin from cache at /home/gly/.cache/torch/transformers/3d1d2b2daef1e2b3ddc2180ddaae8b7a37d5f279babce0068361f71cd548f615.7131dcb754361639a7d5526985f880879c9bfd144b65a0bf50590bddb7de9059
[2022-04-14 21:58:48,009 INFO] All model checkpoint weights were used when initializing BertModel.

[2022-04-14 21:58:48,010 INFO] All the weights of BertModel were initialized from the model checkpoint at bert-base-multilingual-cased.
If your task is similar to the task the model of the ckeckpoint was trained on, you can already use BertModel for predictions without further training.
2022-04-14 21:58:49,262 Model Size: 2191057464
2022-04-14 21:58:49,361 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
2022-04-14 21:58:49,362 /home/gly/download/bert-large-cased.hdf5
Traceback (most recent call last):
  File "train.py", line 121, in <module>
    trainer: trainer_func = trainer_func(student, None, corpus, config=config.config, **config.config[trainer_name], is_test=args.test)
  File "/home/gly/python_workspace/ace/ACE/flair/trainers/reinforcement_trainer.py", line 169, in __init__
    self.assign_predicted_embeddings(doc_sentence_dict,embedding,pretrained_file_dict[embedding.name])
  File "/home/gly/python_workspace/ace/ACE/flair/trainers/distillation_trainer.py", line 1195, in assign_predicted_embeddings
    group = lm_file[key]
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/home/gly/python_workspace/ACE/ace_py37/lib/python3.7/site-packages/h5py/_hl/group.py", line 177, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'conll_03_english_train_-1' doesn't exist)"
wangxinyu0922 commented 2 years ago

你用的数据有DOCSTART 区分doc吗,可以试试看这个数据https://drive.google.com/file/d/1yWzOJtP2ODleke2HshF5dLcJj8y4BEst/view?usp=sharing

gly99999 commented 2 years ago

原来是这样,因为我之前跑sencente-level的时候把数据集那里改成O了,现在直接用O的去跑document-level的模型有这个问题,明白了,感谢~ image