首页 PaddleNLP 帖子详情
求助 长文本大模型 ErnieDocModel Ernie Doc
收藏
快速回复
PaddleNLP 问答训练 24591 0
求助 长文本大模型 ErnieDocModel Ernie Doc
收藏
快速回复
PaddleNLP 问答训练 24591 0

我用Ernie Doc模型,想改变默认的输入长度,但怎么改都出错,

我的各个输入的形状为

inputs
[1, 256, 1]
memories
[1, 256, 768]
position_ids
[1, 768, 1]
attn_mask
[1, 256, 1]

出错信息为

/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlenlp/transformers/ernie_doc/modeling.py in forward(self, input_ids, memories, token_type_ids, position_ids, attn_mask)
670 rel_pos=position_embeddings,
671 rel_task=token_embeddings,
--> 672 attn_mask=n_head_self_attn_mask)
ValueError: (InvalidArgument) Broadcast dimension mismatch. Operands could not be broadcast together with the shape of X = [1, 12, 256, 512] and the shape of Y = [1, 12, 256, 384]. Received [512] in X is not equal to [384] in Y at i:3.
[Hint: Expected x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1 == true, but received x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1:0 != true:1.] (at /paddle/paddle/phi/kernels/funcs/common_shape.h:84)

0
收藏
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户