👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
[Bug]: /home/ubuntu/miniconda3/envs/paddle/lib/python3.10/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1189, in build_relation if negative_mask.sum() > 0: AttributeError: 'bool' object has no attribute 'sum' #8914
Traceback (most recent call last):
File "/data/llm/models/PaddleOCR/tools/eval.py", line 169, in <module>
main()
File "/data/llm/models/PaddleOCR/tools/eval.py", line 151, in main
metric = program.eval(
File "/data/llm/models/PaddleOCR/tools/program.py", line 624, in eval
preds = model(batch)
File "/home/ubuntu/miniconda3/envs/paddle/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1429, in __call__
return self.forward(*inputs, **kwargs)
File "/data/llm/models/PaddleOCR/ppocr/modeling/architectures/base_model.py", line 85, in forward
x = self.backbone(x)
File "/home/ubuntu/miniconda3/envs/paddle/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1429, in __call__
return self.forward(*inputs, **kwargs)
File "/data/llm/models/PaddleOCR/ppocr/modeling/backbones/vqa_layoutlm.py", line 248, in forward
x = self.model(
File "/home/ubuntu/miniconda3/envs/paddle/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1429, in __call__
return self.forward(*inputs, **kwargs)
File "/home/ubuntu/miniconda3/envs/paddle/lib/python3.10/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1329, in forward
loss, pred_relations = self.extractor(sequence_output, entities, relations)
File "/home/ubuntu/miniconda3/envs/paddle/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1429, in __call__
return self.forward(*inputs, **kwargs)
File "/home/ubuntu/miniconda3/envs/paddle/lib/python3.10/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1223, in forward
relations, entities = self.build_relation(relations, entities)
File "/home/ubuntu/miniconda3/envs/paddle/lib/python3.10/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1189, in build_relation
if negative_mask.sum() > 0:
AttributeError: 'bool' object has no attribute 'sum'
软件环境
重复问题
错误描述
稳定复现步骤 & 代码
python3 tools/eval.py -c configs/kie/vi_layoutxlm/re_vi_layoutxlm_xfund_zh.yml -o Architecture.Backbone.checkpoints=pretrain/re_vi_layoutxlm_xfund_pretrained/best_accuracy