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
Post a Comment