Closed lxh111 closed 9 months ago
确保一下依赖包和PaddleOCR要求的是一样的呢?
确保一下依赖包和PaddleOCR要求的是一样的呢?
paddlepaddle-gpu这个官网最高版本就是2.6的,需要自己编译吗
您好,请教一下这个报错您最后是怎么解决的?
您好,请教一下这个报错您最后是怎么解决的?
Facing the same issue, please let me know any solution for this.
同样问题
我这也是出现这个问题,目前看来没有解决方案啊
系统环境/System Environment: 系 统: Centos8 Python: 3.8
版本号/Version: paddle2onnx 1.1.0 paddleclas 2.5.1 paddlefsl 1.1.0 paddlenlp 2.7.1 paddleocr 2.7.0.3 paddlepaddle-gpu 2.6.0.post120
运行指令/Command Code: python3 ./tools/infer_kie_token_ser_re.py -c configs/kie/vi_layoutxlm/re_vi_layoutxlm_xfund_zh.yml -o Architecture.Backbone.checkpoints=./pretrained_model/re_vi_layoutxlm_xfund_pretrained/best_accuracy Global.infer_img=./train_data/XFUND/zh_val/image/zh_val_42.jpg -c_ser configs/kie/vi_layoutxlm/ser_vi_layoutxlm_xfund_zh.yml -o_ser Architecture.Backbone.checkpoints=./pretrained_model/ser_vi_layoutxlm_xfund_pretrained/best_accuracy
完整报错/Complete Error Message: If your task is similar to the task the model of the checkpoint was trained on, you can already use LayoutXLMForRelationExtraction for predictions without further training. [2024/01/25 19:28:27] ppocr INFO: resume from ./pretrained_model/re_vi_layoutxlm_xfund_pretrained/best_accuracy Corrupt JPEG data: premature end of data segment Traceback (most recent call last): File "./tools/infer_kie_token_ser_re.py", line 217, in
result = ser_re_engine(data)
File "./tools/infer_kie_token_ser_re.py", line 151, in call
preds = self.model(re_input)
File "/usr/local/lib64/python3.8/site-packages/paddle/nn/layer/layers.py", line 1429, in call
return self.forward(*inputs, kwargs)
File "/opt/paddle/ocr/PaddleOCR-release-2.7/ppocr/modeling/architectures/base_model.py", line 86, in forward
x = self.backbone(x)
File "/usr/local/lib64/python3.8/site-packages/paddle/nn/layer/layers.py", line 1429, in call
return self.forward(*inputs, *kwargs)
File "/opt/paddle/ocr/PaddleOCR-release-2.7/ppocr/modeling/backbones/vqa_layoutlm.py", line 227, in forward
x = self.model(
File "/usr/local/lib64/python3.8/site-packages/paddle/nn/layer/layers.py", line 1429, in call
return self.forward(inputs, kwargs)
File "/usr/local/lib/python3.8/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1329, in forward
loss, pred_relations = self.extractor(sequence_output, entities, relations)
File "/usr/local/lib64/python3.8/site-packages/paddle/nn/layer/layers.py", line 1429, in call
return self.forward(*inputs, **kwargs)
File "/usr/local/lib/python3.8/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1223, in forward
relations, entities = self.build_relation(relations, entities)
File "/usr/local/lib/python3.8/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1189, in build_relation
if negative_mask.sum() > 0:
AttributeError: 'bool' object has no attribute 'sum'