我用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)