使用 Tensorflow 对象检测训练一定数量的步骤后更改配置文件中的训练参数 API

Change training parameters in the config file after training for a certain number of steps using the Tensorflow Object Detection API

到目前为止,我已经在一个数据集上训练了一个 Inception Resnet v2 模型 61000 步,模型配置文件中的值如下:

adam_optimizer: {
      learning_rate: {
        manual_step_learning_rate {
          initial_learning_rate: 0.0003
          schedule {
            step: 150000
            learning_rate: .0001
          }

现在,如果我想从现在开始降低模型的学习率,将进行以下更改:

adam_optimizer: {
      learning_rate: {
        manual_step_learning_rate {
          initial_learning_rate: 0.0003
          schedule {
            step: 60000
            learning_rate: .0001
          }

从检查点重新开始实际上将我的模型的学习率从 0.0003 降低到 0.0001,因为它到目前为止已经训练的步数大于 60000? 如果没有,还有其他方法可以实现吗?

一种可能的方法是使用已经训练好的61000步模型文件作为fine-tune checkpoint,然后你可以随意修改lr。在这种情况下,您实际上是从第 1 步开始训练。

转到您的配置文件并搜索此节点,然后添加粗体行 train_config: { num_steps: 5000