且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

恢复训练 tf.keras Tensorboard

更新时间:2023-12-02 14:13:34

你可以在函数model.fit()中设置参数initial_epoch为你希望你的训练从哪个时代开始.考虑到模型训练直到达到索引 epochs 的纪元(而不是由 epochs 给出的迭代次数).在您的示例中,如果您想再训练 10 个时期,则应该是:

You can set the parameter initial_epoch in the function model.fit() to the number of the epoch you want your training to start from. Take into account that the model trains until the epoch of index epochs is reached (and not a number of iterations given by epochs). In your example, if you want to train for 10 epochs more, it should be:

model.fit(x_train, y_train, initial_epoch=9, epochs=19, callbacks=[Tensorboard()])

它将允许您以正确的方式在 Tensorboard 上可视化您的绘图.有关这些参数的更多信息,请参阅文档.

It will allow you to visualise your plots on Tensorboard in a correct manner. More extensive information about these parameters can be found in the docs.