Hi guys
I am a learner of tensorflow. I met a problem with the placeholder. The key here is that, I want to change the size of data to feed the 'feed_dict', but it fails all the time.
In detail, at first I give
x = tf.placeholder("float", [None, n_input])
y = tf.placeholder("float", [None, n_output])
then after many steps, I run
res = sess.run(optimizer, feed_dict = {x: batch_x, y : batch_y })
where batch_x and batch_y's values are given previously.
Now I want to change the size of placehold to, eg.
x = tf.placeholder("float", [None, m_input])
and update the weights matrix W accordingly. However,
res = sess.run(optimizer, feed_dict = {x: batch_x, y : batch_y })
cannot be run. it says
InvalidArgumentError: you must feed a value for placeholder tensor 'Placeholder_5' with dtype float
where 'Placeholder_5' is the x that firstly defined (not the updated one).
I read some article saying that I can use
x = tf.placeholder("float", [None, None])
as open-size variable and feed it without re-define another x placeholder. However, it still does not work
Is there anyone knowing that how to change the size of placeholder?
Thanks