小编Rob*_*obR的帖子

Tensorflow:如何在Tensorboard中显示自定义图像(例如Matplotlib图)

Tensorboard自述文件的图像仪表板部分说:

由于图像仪表板支持任意png,因此您可以使用它将自定义可视化(例如matplotlib散点图)嵌入到TensorBoard中.

我看到如何将pyplot图像写入文件,作为张量读回,然后与tf.image_summary()一起使用以将其写入TensorBoard,但自述文件中的这一陈述表明有更直接的方法.在那儿?如果是这样,是否有任何进一步的文档和/或示例如何有效地执行此操作?

python matplotlib tensorflow tensorboard

27
推荐指数
4
解决办法
2万
查看次数

交错tf.data.Datasets

我正在尝试使用tf.data.Dataset交错两个数据集,但遇到了问题.给出这个简单的例子:

ds0 = tf.data.Dataset()
ds0 = ds0.range(0, 10, 2)
ds1 = tf.data.Dataset()
ds1 = ds1.range(1, 10, 2)
dataset = ...
iter = dataset.make_one_shot_iterator()
val = iter.get_next()
Run Code Online (Sandbox Code Playgroud)

什么是...产生类似的输出0, 1, 2, 3...9

似乎dataset.interleave()似乎是相关的,但我无法以不产生错误的方式表达语句.

tensorflow

9
推荐指数
2
解决办法
4523
查看次数

如何实现标记嵌入的中心损失和其他运行平均值

最近的一篇论文(这里)介绍了他们称为中心损失的二次损失函数.它基于批处理中的嵌入与每个相应类的运行平均嵌入之间的距离.TF Google小组(此处)已就如何计算和更新此类嵌入中心进行了一些讨论.我在下面的答案中汇总了一些代码来生成类平均嵌入.

这是最好的方法吗?

tensorflow

6
推荐指数
1
解决办法
1385
查看次数

Tensorboard 事件文件很大并且还在增长

我正在训练一个相当复杂的网络,并注意到事件文件在训练期间继续增长,并且可以达到 2GB 或更大的大小。我假设事件文件的大小在整个培训课程中应该大致恒定——对吗?我尝试使用 tf.get_default_graph().finalize() 根据mrry 的建议放置在训练循环之前,但这并没有导致任何错误。我还能如何调试这个?

tensorflow

5
推荐指数
0
解决办法
2220
查看次数

初始build_imagenet_data.py TypeError:'RGB'具有类型<class'str'>,但应为以下之一:(<class'bytes'>,)

我想用在_convert_to_example()函数的稍加改变build_imagenet_data.py

def _convert_to_example(filename, image_buffer, label, bboxes, height, width):

  xmin = []
  ymin = []
  xmax = []
  ymax = []
  for b in bboxes:
    assert len(b) == 4
    # pylint: disable=expression-not-assigned
    [l.append(point) for l, point in zip([xmin, ymin, xmax, ymax], b)]
    # pylint: enable=expression-not-assigned

    colorspace = 'RGB'
    channels = 3
    image_format = 'JPEG'

    example = tf.train.Example(features=tf.train.Features(feature={
      'image/height': _int64_feature(height),
      'image/width': _int64_feature(width),
      'image/colorspace': _bytes_feature(colorspace),
      'image/channels': _int64_feature(channels),
      'image/class/label': _int64_feature(label),
      'image/object/bbox/xmin': _float_feature(xmin),
      'image/object/bbox/xmax': _float_feature(xmax),
      'image/object/bbox/ymin': _float_feature(ymin),
      'image/object/bbox/ymax': _float_feature(ymax),
      'image/object/bbox/label': _int64_feature(label),
      'image/format': _bytes_feature(image_format), …
Run Code Online (Sandbox Code Playgroud)

tensorflow

4
推荐指数
1
解决办法
2982
查看次数

标签 统计

tensorflow ×5

matplotlib ×1

python ×1

tensorboard ×1