tensorflow - How to know the shape of the input X which is a placeholder in TF -


i have code:

x = tf.placeholder(dtype=tf.float32, shape=[none, 28, 28, 1]) w = tf.variable... .... z ... 

z tensor , calculated x, here know batch size of z, i.e., first element value of z, have tried z.get_shape()[0].value , tf.shape(z)[0]. both results none, how solve?

thanks in advance.

here example of how u can it:

z = tf.variable(tf.zeros(shape=(2, 3, 4))) tf.session() sess:     print sess.run(tf.shape(z)) 

since in tf in session need run session excute function want run !


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -