zoukankan      html  css  js  c++  java
  • keras 在train_on_batch中启用tensorboard

    def write_log(callback, names, logs, batch_no):
        for name, value in zip(names, logs):
            summary = tf.Summary()
            summary_value = summary.value.add()
            summary_value.simple_value = value
            summary_value.tag = name
            callback.writer.add_summary(summary, batch_no)
            callback.writer.flush()

    在训练的时候,调用上述函数,写入tensorboard

      loss = model.train_on_batch([x1,x2],y)
      write_log(tensorboard_cb,["trainloss","me"],loss,bathNo)
  • 相关阅读:
    CCS
    CCS
    CCS
    CCS
    CCS
    CCS
    CCS
    CCS
    Java之内部类
    Java之回调模式和ThreadLocal
  • 原文地址:https://www.cnblogs.com/superxuezhazha/p/10975457.html
Copyright © 2011-2022 走看看