python - 使用 Keras 和 fit_generator 的 TensorBoard 分布和直方图

标签 python tensorflow keras tensorboard

我正在使用 Keras 使用 fit_generator 函数训练 CNN。

好像是known issue TensorBoard 在此设置中不显示直方图和分布。

有没有人想办法让它发挥作用?

最佳答案

没有简单的方法只用一行代码插入它,您必须手动编写摘要。

好消息是它并不难,您可以使用 TensorBoard callback code在 Keras 作为引用。 (还有一个 version 2 为 TensorFlow 2.x 做好准备。)

基本上,编写一个函数,例如write_summaries(model) 并在您想编写摘要时调用它(例如,在您的 fit_generator() 之后)

在你的 write_summaries(model) 函数中使用 tf.summaryhistogram_summary 和其他摘要函数来记录你想在 tensorboard 上看到的数据.

如果您不确切知道如何检查 official tutorial : 和 MNIST with summaries 这个很好的例子.

关于python - 使用 Keras 和 fit_generator 的 TensorBoard 分布和直方图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42425858/

相关文章:

python - Fabric 将停止 redis 服务器,但不会再次启动它

tensorflow - 如何在张量板上可视化张量摘要

python - 导入Cartopy时ImportError : DLL load failed while importing trace: The specified module could not be found

android - 无法运行 python-bluez RFCOMM 服务器示例脚本

machine-learning - tensorflow tf.nn.conv2d 中的特征编号

python - 在ubuntu中安装ujson的问题

python - 为什么会出现这个错误:"Sliced assignment is only supported for variables"

python - 如何在 Django 的多个同时进行的 Keras 分类器 session 中进行预测?

python - keras ReLU 层的意外输出

python - 创建一个打印雪花的二维数组 PYTHON