【问题标题】:Use python code to read accuracy rather than tensorboard使用python代码读取准确性而不是tensorboard
【发布时间】:2020-11-22 03:08:08
【问题描述】:

我使用的是 TensorFlow 2.2。

我已将每个 epoch 的准确性写入事件以供 tensorboard 读取。是否可以使用python获取事件文件信息?如果有,是否有任何代码示例?

【问题讨论】:

    标签: python python-3.x tensorflow tensorflow2.0 tensorboard


    【解决方案1】:

    在 Keras 中,当您训练模型时,您将拥有如下所示的代码。如代码所示,可以得到训练准确率、训练损失、验证准确率和验证损失。

    results = model.fit_generator(generator = generators[0], validation_data= generators[2], 
                                   epochs=epochs, initial_epoch=start_epoch,
                                   callbacks = callbacks, verbose=1)
    acc=results.history['accuracy']
    loss=results.history['loss']
    vacc =results.history['val_accuracy']
    vloss=results.history['val_loss']
    
    each is a list containing the data for each epoch
    
    

    【讨论】:

      猜你喜欢
      • 2013-09-04
      • 2013-07-28
      • 1970-01-01
      • 2020-06-01
      • 2021-09-27
      • 2021-05-28
      • 1970-01-01
      • 1970-01-01
      • 2017-05-24
      相关资源
      最近更新 更多