预测遇到报错
Created by: ws441572091
保存模型时,feed的list中包含输入和labels fluid.io.save_inference_model(tmp_params_dirname,['words','labels'],[crf_decode],exe) 预测的reader为 yield words,labels 数据例子:[42, 14, 127, 47, 6, 17, 79, 13, 60, 236, 16, 1111, 624, 3], [12, 6, 6, 0, 0, 0, 8, 5, 5, 5, 0, 7, 1, 0] 预测的代码如下,运行没有问题
现在希望保存模型时,feed的list中只包含输入
fluid.io.save_inference_model(tmp_params_dirname,['words'],[crf_decode],exe) 预测的reader修为yield words 数据例子:[42, 14, 127, 47, 6, 17, 79, 13, 60, 236, 16, 1111, 624, 3] 报错:The number of fields in data (14) does not match len(feed_list) (1)
在外面加了一层list之后,数据例子:[[42, 14, 127, 47, 6, 17, 79, 13, 60, 236, 16, 1111, 624, 3]] 报错:The Input(Label) should be a 2-D tensor with the 2nd dimensions fixed to 1.