模型训练输入与预测输入转换问题
Created by: ylxsyf
1)模型训练输入: 2) 模型测试输入: 3)对应reader的输入: yield word_idx, layer_idx, class_idx
问题描述: 因为reader里面的word_idx, layer_idx都是N1维度的,但是class_idx是N10维的(可以认为N是batch_size),报错: class_attr = to_lodtensor([x[2] for x in data], place) File "/home/disk5/nlp/paddle/sequence_tagging_for_ner/utils_extend.py", line 24, in to_lodtensor flattened_data = flattened_data.reshape([len(flattened_data), 1]) ValueError: cannot reshape array of size 12400 into shape (620,1)