【发布时间】:2020-09-14 07:29:20
【问题描述】:
我总共要训练 500 个 epoch。但是在 google colab 中完成每个 epoch 需要 8 分钟。任何人都可以帮助我如何在特定数量的时期完成后保存我的模型状态并从我离开谷歌 Colab 的地方重新开始训练??
【问题讨论】:
-
欢迎来到 SO。请考虑发布相关代码。
-
您可以在 colab 上安装您的 Google Drive,并在每个
nepochs 之后将 model_dict 直接保存/加载到您的驱动器中。这是example -
这里是如何在 pytorch 中保存和加载检查点的一般示例。 - pytorch.org/tutorials/recipes/recipes/…
-
from imageai.Detection.Custom import DetectionModelTrainer trainer = DetectionModelTrainer() trainer.setModelTypeAsYOLOv3() trainer.setDataDirectory(data_directory="/content/drive/My Drive/Dataset") trainer.setTrainConfig(object_names_array= ["object1","object 2"], batch_size=4, num_experiments=421) trainer.trainModel()
-
这是我的代码
标签: python tensorflow pytorch