TensorFlow evaluation.predict () gives a WARNING: tensorflow: input graph does not contain QueueRunner

I am trying to get a prediction with a custom input function using estimator.predict, but this gives me the following:

WARNING:tensorflow:Input graph does not contain a QueueRunner. That means predict yields forever. This is probably a mistake.

This does not give me an error, but predictsimply says that it restores the parameters and does not return the actual forecasts. Here is my code:

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))

I examined this problem , but I could not find a solution related to my problem. Why is TensorFlow showing this warning and how can I get rid of it?

+8
source share
3 answers

, https://github.com/tensorflow/tensorflow/issues/11621

, , , :). , API- Datasets . (AFAICT API () , tf.errors.OutOfRangeError, , , QueueRunner , , , , .) @xiejw ?

, , .

+3

, :

tf.estimator.Estimator._validate_features_in_predict_input = lambda *args: None

tensorflow.

, , .

+2

I got the same error. However, to see the values ​​in the prediction (line by line), I used the operator __next__(). Thus, the code to display the following next line:print(predictions.__next__)

0
source

All Articles