TypeError: reduce() of empty sequence with no initial value
Created by: Jarlonyan
#---------------predict----------------------------
239 feeding = ['dnn2_input_layer']
240 infer_data = []
241 infer_data_label = []
242 for item in cluster_data_reader( cluster_test_dir, node_id)():
243 infer_data.append(item[0:-1])
244 infer_data_label.append(item[-1])
245 test_data=[]
246 for x in infer_data:
247 a_data=np.array([ 0.0 for i in range(0,512)])
248 for index in np.array(x).reshape(-1):
249 a_data += embed_matrix[index]
250 test_data.append(list(a_data))
251 predictions = paddle.infer( output_layer=dnn2_output,
252 parameters=dnn2_parameters,
253 input=test_data,
254 field=['value'],
255 feeding=feeding )
256 print predictions
结果报错:
File "my_dnn_local.py", line 255, in dnn_forward_predict
feeding=feeding )
TypeError: reduce() of empty sequence with no initial value