-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
example下的ee执行predict.py报错 #540
Comments
您好,当出现 |
请问您还有其他问题吗? |
感谢大侠热心的的答复,我按照建议把train.yaml的task_name由trigger改成role之后报另外一个错误了,这次不是cuda错误: ===================================BUG REPORT=================================== python -m bitsandbytes and submit this information together with your error trace to: https://github.com/TimDettmers/bitsandbytes/issuesbin /root/anaconda3/envs/deepke/lib/python3.9/site-packages/bitsandbytes/libbitsandbytes_cuda118.so Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace. |
另外我想确定一下,我去huggingface下载google下的bert-base-chinese模型给ee例子用,这样做行不行的? |
您好,从报错信息来看这里你修改参数后是直接运行的predict.py文件?您将train.yaml中的taskname改为role了之后需要再次运行python run.py,去训练一个事件元素抽取模型,我们在README中有提到对于事件抽取任务,需要训练两个阶段的模型。
从huggingface上下载是没有问题的。 |
感谢大侠热心答复:—)
|
附上两个配置文件哈 ************** train.yaml ****************** data_name: DuEE # [ACE, DuEE] *************** predict.yaml *************** defaults:
data_name: DuEE # [ACE, DuEE] do_pipeline_predict: True dev_trigger_pred_file: ./exp/DuEE/trigger/bert-base-chinese/eval_pred.json # change to your pred file of trigger classification |
您好,这里的报错为 |
感谢指导,不知道我的yaml文件什么毛病,现在搞定了dev_trigger_pred_file和test_trigger_pred_file参数为空的问题后报了下面的错误,方便的话可以加我微信一起看一下吗?非常感谢 [2024-06-24 17:34:19,321][deepke.event_extraction.standard.bertcrf.processor_ee][INFO] - LOOKING AT /root/DeepKE/example/ee/standard/./data/DuEE/role/dev_with_pred_trigger.tsv train |
ee的问题解决了,是因为hydra-core版本不是1.3.1的缘故,感谢大神 |
git下载后执行run.py报错说bert-base-chinese找不到,我去hf找到google的bert-base-chinese模型下载到本地后执行run.py成功了,然后执行predict.py报如下错误:
Screenshots
[2024-06-21 08:33:07,466][run][INFO] - Saving features into cached file /root/DeepKE/example/ee/standard/./data/DuEE/trigger/cached_dev_bert-base-chinese_256
[2024-06-21 08:33:08,084][run][INFO] - ***** Running evaluation *****
[2024-06-21 08:33:08,084][run][INFO] - Num examples = 1498
[2024-06-21 08:33:08,085][run][INFO] - Batch size = 16
[2024-06-21 08:33:08,085][run][INFO] - Mode = dev
Evaluating: 0%| | 0/94 [00:00<?, ?it/s]../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [0,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [1,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [2,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [3,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [4,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [5,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [6,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [7,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [8,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [9,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [10,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [11,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [12,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [13,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [14,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:144: operator(): block: [0,0,0], thread: [15,0,0] Assertion
idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.Evaluating: 0%| | 0/94 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/root/DeepKE/example/ee/standard/predict.py", line 115, in main
result, eval_pred_list = evaluate(args, model, eval_dataset, tokenizer, labels, pad_token_label_id, mode="dev", device=device)
File "/root/DeepKE/example/ee/standard/run.py", line 219, in evaluate
outputs = model(pad_token_label_id=pad_token_label_id, **inputs)
File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "/root/DeepKE/src/deepke/event_extraction/standard/bertcrf/bert_crf.py", line 89, in forward
loss = self.crf.neg_log_likelihood(crf_logits, crf_mask, crf_labels)
File "/root/DeepKE/src/deepke/event_extraction/standard/bertcrf/crf.py", line 273, in neg_log_likelihood
gold_score = self._score_sentence(scores, mask, tags)
File "/root/DeepKE/src/deepke/event_extraction/standard/bertcrf/crf.py", line 258, in _score_sentence
tg_energy = tg_energy.masked_select(mask.transpose(1, 0))
RuntimeError: CUDA error: device-side assert triggered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with
TORCH_USE_CUDA_DSA
to enable device-side assertions.Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
其它范例如ner/re/ae都能执行成功就ee失败,麻烦帮看一下怎么解决哈
The text was updated successfully, but these errors were encountered: