在以下代码中:
self.estimator = tf.estimator.DNNRegressor( ... )
...
predictions = self.estimator.predict(predict_features)
print("predictions: {}".format(type(predictions)))
while True:
try:
result = next(predictions)
predict_labels.append(result)
except StopIteration:
return predict_labels
第二行报告预测为class 'generator'
。但是,第result = next(predictions)
行在第0次迭代中产生了此异常:
TypeError: unsupported callable
你能告诉我我在做什么错吗?