模型本地预测可以,mpi预测模型时出错
Created by: shenchong721
infer函数中使用的是paddle.data_type.sparse_float_vector,使用paddle api提交后显示 'module' object has no attribute 'sparse_float_vector'。
按照#8926 (closed) 说明,用sparse_vector代替sparse_float_vector,之后再运行时,显示如下错误,感觉是数据类型出了问题,因为在代码本地预测是正常运行的
Mon Mar 26 22:47:19 2018[1,0]:Traceback (most recent call last): Mon Mar 26 22:47:19 2018[1,0]: File "conf/trainer_config.conf", line 200, in Mon Mar 26 22:47:19 2018[1,0]: infer(model_path=model_path, batch_size=30000) Mon Mar 26 22:47:19 2018[1,0]: File "conf/trainer_config.conf", line 182, in infer Mon Mar 26 22:47:19 2018[1,0]: output = inferer.infer(input=test_batch,flatten_result=False,field=['value'],feeding=feeding) Mon Mar 26 22:47:19 2018[1,0]: File "/home/disk1/normandy/maybach/662947/workspace/python27-gcc482/lib/python2.7/site-packages/paddle/v2/inference.py", line 74, in infer Mon Mar 26 22:47:19 2018[1,0]: for result in self.iter_infer_field(field=field, **kwargs): Mon Mar 26 22:47:19 2018[1,0]: File "/home/disk1/normandy/maybach/662947/workspace/python27-gcc482/lib/python2.7/site-packages/paddle/v2/inference.py", line 61, in iter_infer_field Mon Mar 26 22:47:19 2018[1,0]: for result in self.iter_infer(**kwargs): Mon Mar 26 22:47:19 2018[1,0]:TypeError: iter_infer() got an unexpected keyword argument 'flatten_result'