Closed wh403948123 closed 6 months ago
在Xfound数据集下训练,SER没有问题,但是RE就是报这个paddlenlp内部错误,paddleocr 2.7, paddlenlp 2.5(2.6)都试过了,还是一样!请问如何解决?
paddleocr==2.5 , paddlenlp==2.5 试下这两个版本的代码吧
问题解决了嘛
你好,问题解决了吗
问题未解决,也不知道是代码没有人维护,还是解决问题的周期太长。反正现在换赛道了,不用这个平台的东西了。
我目前试了这个版本可以 pip install paddlepaddle-gpu==2.5.1.post117 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html numpy==1.23.0 paddlenlp==2.5.2 paddleocr==2.6.1
[2024-03-23 09:19:22,001] [ INFO] - All the weights of LayoutXLMForRelationExtraction were initialized from the model checkpoint at D:/demo/PaddleOCR/pretrained_model/re_vi_layoutxlm_xfund_pretrained/best_accuracy. 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/03/23 09:19:22] ppocr INFO: train dataloader has 75 iters [2024/03/23 09:19:22] ppocr INFO: valid dataloader has 7 iters [2024/03/23 09:19:22] ppocr INFO: resume from D:/demo/PaddleOCR/pretrained_model/re_vi_layoutxlm_xfund_pretrained/best_accuracy [2024/03/23 09:19:22] ppocr WARNING: D:/demo/PaddleOCR/pretrained_model/re_vi_layoutxlm_xfund_pretrained/best_accuracy.pdopt is not exists, params of optimizer is not loaded [2024/03/23 09:19:22] ppocr INFO: During the training process, after the 0th iteration, an evaluation is run every 19 iterations Traceback (most recent call last): File "C:\PyCharm Community Edition 2023.3.4\plugins\python-ce\helpers\pydev\pydevd.py", line 1534, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "C:\PyCharm Community Edition 2023.3.4\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:\demo\PaddleOCR\tools\train.py", line 442, in
re_main_train()
File "D:\demo\PaddleOCR\tools\train.py", line 435, in re_main_train
main(config, device, logger, vdl_writer)
File "D:\demo\PaddleOCR\tools\train.py", line 199, in main
program.train(config, train_dataloader, valid_dataloader, device, model,
File "D:\demo\PaddleOCR\tools\program.py", line 304, in train
preds = model(batch)
File "D:\AnacondaMain\envs\ppocr\lib\site-packages\paddle\nn\layer\layers.py", line 1429, in call
return self.forward(*inputs, kwargs)
File "D:\demo\PaddleOCR\ppocr\modeling\architectures\base_model.py", line 86, in forward
x = self.backbone(x)
File "D:\AnacondaMain\envs\ppocr\lib\site-packages\paddle\nn\layer\layers.py", line 1429, in call
return self.forward(*inputs, *kwargs)
File "D:\demo\PaddleOCR\ppocr\modeling\backbones\vqa_layoutlm.py", line 227, in forward
x = self.model(
File "D:\AnacondaMain\envs\ppocr\lib\site-packages\paddle\nn\layer\layers.py", line 1429, in call
return self.forward(inputs, kwargs)
File "D:\demo\PaddleOCR\paddlenlp\transformers\layoutxlm\modeling.py", line 1329, in forward
loss, pred_relations = self.extractor(sequence_output, entities, relations)
File "D:\AnacondaMain\envs\ppocr\lib\site-packages\paddle\nn\layer\layers.py", line 1429, in call
return self.forward(*inputs, **kwargs)
File "D:\demo\PaddleOCR\paddlenlp\transformers\layoutxlm\modeling.py", line 1223, in forward
relations, entities = self.build_relation(relations, entities)
File "D:\demo\PaddleOCR\paddlenlp\transformers\layoutxlm\modeling.py", line 1189, in build_relation
if negative_mask.sum() > 0:
AttributeError: 'bool' object has no attribute 'sum'
python-BaseException