【Tensorflow 学习笔记】placeholder

tf.placeholder(dtype, shape=None, name=None)

TensorFlow中的占位符,用于传入外部数据。

参数:

  • dtype:数据类型。
  • shape:数据的维度。默认为None,表示没有限制
  • name:名称

返回类型:Tensor

TensorFlow中加载图片的维度为[batch, height, width, channels]

故placeholder的shape可写为[None, None, None, 3]

data = tf.placeholder(tf.float32, shape=[None, None, None, 3])
feed_dict = {data:images}


猜你喜欢

转载自blog.csdn.net/u014657795/article/details/81041033
今日推荐