运行lambdarank demo infer阶段代码报错
Created by: MiraiJ
执行ltr中的lambdarank的infer出现错误,数据为demo中mq2007中的数据。 https://github.com/PaddlePaddle/models/tree/develop/ltr 在lambda_rank.py中infer_data是array,但是到dataprovider_converter.py中dat为一个float型,错误如下,
Traceback (most recent call last): File "lambda_rank.py", line 137, in <module> lambda_rank_infer(pass_id=args.num_passes - 1) File "lambda_rank.py", line 120, in lambda_rank_infer output_layer=output, parameters=parameters, input=infer_data) File "/home/yitengfei/python27-gcc482/lib/python2.7/site-packages/paddle/v2/inference.py", line 158, in infer return inferer.infer(field=field, input=input, feeding=feeding) File "/home/yitengfei/python27-gcc482/lib/python2.7/site-packages/paddle/v2/inference.py", line 93, in infer for result in self.iter_infer_field(field=field, **kwargs): File "/home/yitengfei/python27-gcc482/lib/python2.7/site-packages/paddle/v2/inference.py", line 80, in iter_infer_field for result in self.iter_infer(**kwargs): File "/home/yitengfei/python27-gcc482/lib/python2.7/site-packages/paddle/v2/inference.py", line 73, in iter_infer yield self.__gradient_machine__.forwardTest(feeder(data_batch)) File "/home/yitengfei/python27-gcc482/lib/python2.7/site-packages/py_paddle/dataprovider_converter.py", line 284, in __call__ return self.convert(dat, argument) File "/home/yitengfei/python27-gcc482/lib/python2.7/site-packages/paddle/v2/data_feeder.py", line 133, in convert return DataProviderConverter.convert(self, reorder_data(dat), argument) File "/home/yitengfei/python27-gcc482/lib/python2.7/site-packages/py_paddle/dataprovider_converter.py", line 269, in convert scanner.pre_scan(each_step) File "/home/yitengfei/python27-gcc482/lib/python2.7/site-packages/py_paddle/dataprovider_converter.py", line 227, in pre_scan self.__inner_scanner__.pre_scan(each) File "/home/yitengfei/python27-gcc482/lib/python2.7/site-packages/py_paddle/dataprovider_converter.py", line 116, in pre_scan "The input should be a vector, please check your input data." ValueError: The input should be a vector, please check your input data.