Yuvraj
Yuvraj

Reputation: 66

feeding tensorflow data into placeholder Tensorflow

I am getting an error while I am feeding data into a placeholder code gist is kmeans.py

The error is:

tensorflow.python.framework.errors.InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder' with dtype float and shape [200,2]
[[Node: Placeholder = Placeholder[dtype=DT_FLOAT, shape=[200,2], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

Upvotes: 0

Views: 185

Answers (1)

Amitayus
Amitayus

Reputation: 51

The one that is fed into placeholder should not be a tensorflow tensor. For example, if the data type of x in following line is one tensor,

sess.run(some_fetches, feed_dict={input: x})

Then it will failed to run. This one will be ok,

sess.run(some_fetches, feed_dict={input: sess.run(x)})

So ugly!

Upvotes: 1

Related Questions