tesorflow数据结构转化

_input_r = tf.reshape(_input, shape=[-1, 28, 28, 1])
  • tensorflow支持四维数据结构,将_input转化为四维数据结构。
  • [n, h, w, c]
  • [-1, , ,]:-1表示Batch,赋值为-1,是让tensorflow自己根据后面三个参数去计算第一个参数的值。
  • [-1, 28 ,28, ]:图像大小
  • [-1, 28, 28, 1]:表示channel1,黑白图片

猜你喜欢

转载自blog.csdn.net/Miracle_520/article/details/85267942