batch大小不固定
Created by: hitxujian
文本分类; 我的 输入纬度是2纬的,但是大小不固定(batch_size,seq_len) 这里的 seq_len 是不定长度的
pytorch 转成onnx的时候是可以的
但是 利用 X2paddle 转换的时候报错
model ir_version: 6, op version: 11 Unknown shape for input tensor[tensor name: 'x2paddle_inputs'] -> shape: [64, 'seqLen'], Please define shape of input here, Note:you can use visualization tools like Netron to check input shape. Shape of Input(e.g. -1,3,224,224), enter 'N' to skip: 64,-1 Unknown shape for input tensor[tensor name: 'x2paddle_input_types'] -> shape: [64, 'seqLen'], Please define shape of input here, Note:you can use visualization tools like Netron to check input shape. Shape of Input(e.g. -1,3,224,224), enter 'N' to skip: 64,-1
我这里填充的 是 64,-1
因为 batch是固定的,-1表示 seq_len 不固定
最后报错
File "/home/lwh/anaconda3/envs/xujian1/lib/python3.6/site-packages/x2paddle-0.8.1-py3.6.egg/x2paddle/op_mapper/onnx2paddle/opset9/opset.py", line 1145, in MatMul if y_shape[0] == 1 and x_shape[-1] != 1 and x_shape[0] != 1: IndexError: list index out of range