【发布时间】:2017-10-20 21:10:04
【问题描述】:
我正在尝试使用带有estimator.predict 的自定义输入函数进行预测,但它给了我这个:
WARNING:tensorflow:Input graph does not contain a QueueRunner. That means predict yields forever. This is probably a mistake.
它没有给我一个错误,但predict 只是说它的恢复参数并没有返回实际的预测。这是我的代码:
test_data = [0.03, 0.91, 0.95, 0.10, 0.56, 0.93]
test_data_in = { k: test_data[index] for index, k in enumerate(FEATURES) }
print(test_data_in)
def predict_input_fn(data_set):
feature_cols = { k: tf.reshape(tf.constant(data_set[k], dtype=tf.float32), [-1]) for k in FEATURES }
return feature_cols
predictions = estimator.predict(input_fn=lambda: predict_input_fn(test_data_in))
print(list(predictions))
我查看了this 问题,但找不到与我的问题相关的解决方案。为什么 TensorFlow 会显示此警告,我该如何消除它?
【问题讨论】:
-
该死的,刚刚发现这个(遇到同样的问题),没有答案?
标签: python machine-learning tensorflow