Closed lixiang1991 closed 6 months ago
我做re训练的时候同样遇到了这个错误 ,我按照你介绍的方式把is改成==,但是在训练完成后进行预测的时候报错了,信息如下:Traceback (most recent call last): File "/home/ocr/PaddleOCR-release-2.7.1/./tools/infer_kie_token_ser_re.py", line 218, in result = ser_re_engine(data) File "/home/ocr/PaddleOCR-release-2.7.1/./tools/infer_kie_token_ser_re.py", line 152, in call preds = self.model(re_input) File "/usr/local/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1429, in call return self.forward(*inputs, kwargs) File "/home/ocr/PaddleOCR-release-2.7.1/ppocr/modeling/architectures/base_model.py", line 86, in forward x = self.backbone(x) File "/usr/local/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1429, in call return self.forward(*inputs, *kwargs) File "/home/ocr/PaddleOCR-release-2.7.1/ppocr/modeling/backbones/vqa_layoutlm.py", line 220, in forward x = self.model( File "/usr/local/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1429, in call return self.forward(inputs, kwargs) File "/usr/local/lib/python3.10/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1329, in forward loss, pred_relations = self.extractor(sequence_output, entities, relations) File "/usr/local/lib/python3.10/site-packages/paddle/nn/layer/layers.py", line 1429, in call return self.forward(*inputs, **kwargs) File "/usr/local/lib/python3.10/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1223, in forward relations, entities = self.build_relation(relations, entities) File "/usr/local/lib/python3.10/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1167, in build_relation all_possible_relations = paddle.stack( File "/usr/local/lib/python3.10/site-packages/paddle/tensor/manipulation.py", line 2001, in stack return _C_ops.stack(x, axis) ValueError: (InvalidArgument) x dim number should greater than 0, but received value is: 0 [Hint: Expected x_dim > 0, but received x_dim:0 <= 0:0.] (at ../paddle/phi/backends/gpu/gpu_launch_config.h:166)
请问你那有没有出现这个问题?
This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。
This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。
软件环境
重复问题
错误描述
稳定复现步骤 & 代码
7840 https://github.com/PaddlePaddle/PaddleNLP/commit/2560f2da0202a2985a142a327107edb9580cf3aa#diff-2742b8e7477bc6c550f7ac3a94fe8bbe2f3726eef2b56cdac75d187e9f9a44fc
不清楚这里为什么要把==改成is,在用paddleocr中的infer_kie_token_ser_re.py时,调用了paddlenlp2.6.1中的re,运行到
if negative_mask.sum() > 0:
我的python版本是3.9。negative_mask = paddle.any(mask, axis=1) is False
的结果就是negative_mask=False
,然后下面的negative_mask.sum()就报bool没有sum方法的错。 我自己把is改成==就正常了