I am working on creating a simple toy example in TensorFlow, and I came across a strange error. I have two placeholders that are defined as follows:
x = tf.placeholder(tf.float32, shape=[None,2]) [two-parameter input] y_ = tf.placeholder(tf.float32, shape=[None,2]) [one-hot labels]
Later I will try to pass these feed_dict placeholders, which are defined as:
feed_dict={x: batch[0].astype(np.float32), y_: batch[1].astype(np.float32)}
Where batch[0]
and batch[1]
are like numpy ndarrays of size (100,2) [confirmed by printing their respective sizes]
When I try to run the model, I get an error message:
"InvalidArgumentError: you must pass the value of the 'Placeholder' placeholder tensor with a dtype float
caused by my Alternate "x" as defined above
Can anyone tell me what I'm doing wrong? I looked through a few examples on the Internet and it looks like this should work ... Is there any other way to populate placeholders with values ββfrom numpy arrays?
If this helps, I work in Ubuntu, SCL, and Python 2.7, and I have all the standard numpy and tensorflow packages installed.
source share