tensorflow学习笔记(九):tf.shape()与tensor.get_shape()
2016-10-23 22:19
495 查看
两种方法都可以获得变量的shape
我们经常会这样来
tf.shape(x)
其中x可以是tensor,也可不是tensor,返回是一个tensor.shape=tf.placeholder(tf.float32, shape=[None, 227,227,3] )
我们经常会这样来
feed数据,如果在运行的时候想知道
None到底是多少,这时候,只能通过
tf.shape(x)[0]这种方式来获得.
tensor.get_shape()
只有tensor有这个方法, 返回是一个tuple相关文章推荐
- TensorFlow 学习:tensor.get_shape() 与 tf.shape(a)
- TensorFlow教程——获取Tensor的维度(tf.shape(x)、x.shape和x.get_shape()的区别)
- tf.reshape和tf.Tensor.get_shape()
- tf.shape(a)和a.get_shape()
- tensorflow API: tf.get_variable
- tf.shape和get_shape()
- tensorflow variable_scope,tf.name_scope, tf.variable, tf.get_varible
- Tensorflow API 学习(2)-tf.shape(a)和a.get_shape()
- tensorflow学习之路(4):tf.shape(xxx) vs. xxx.get_shape()
- #tensorflow学习笔记#理解tf.get_variable
- tensor.get_shape()
- 17、Tensorflow:tf.shape(xxx) vs. xxx.get_shape()
- tf.shape()与tf.get_shape()
- Tensorflow -tf.shape(a)和a.get_shape()
- TensorBoard对训练过程可视化(不用tf.summaries.merge_all)
- ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[100,35,35,64
- 【tensorflow】Input to reshape is a tensor with xxx values, but the requested shape requires a multipl
- tensorflow tf.tile 实例
- 显存不够----ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[4096]
- tensorflow tf.split 和 tf.unstack 实例