tf.summary.image(
name,
tensor,
max_outputs=3,
collections=None,
family=None
)
定义于:tensorflow/python/summary/summary.py
输出Summary带有图像的协议缓冲区。
构建的图像的Tensor必须是4-D形状[batch_size, height, width, channels], 其中channels可以是:
1: tensor被解析成灰度图像。
3:tensor被解析成RGB图像。
4:tensor被解析成RGBA图像
图像具有与输入张量相同的通道数。对于浮点输入,将值一次标准化为一个在[0, 255], uint8值不变。op使用两种不同的规范化算法:
如果输入值都是正数,则重新调整它们,因此最大值为255。
如果任何输入值为负,则移动值,使输入值0.0为127.然后重新调整它们,使得最小值为0,或者最大值为255。
参数:
name:生成的节点的名称。也将作为TensorBoard中的系列名称。
tensor:uint8或者float32型的4-D Tensor[batch_size, height, width, channels],其中channels为1, 3 或者4。
max_outpus:要生成图像的最大批处理元素数。
collections:ops.GraphKeys的可选列表。要添加摘要的集合。默认为[_ops.GraphKeys.SUMMARIES]。
family:可选的; 如果提供,则用作摘要标记名称的前缀,该名称控制用于在Tensorboard上显示的选项卡名称。
返回值:
Tensor:string类型的序列化Summary协议缓冲区。
tf.summary.image('images_with_distorted_bounding_box',image_with_distorted_box)