在以下代码中:
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次迭代中生成了此异常:
class 'generator'
result = next(predictions)
TypeError: unsupported callable