Search code examples
tensorflowdeep-learningobject-detection-apitransfer-learning

Can you change your learning rate while training in Tensorflow Object Detection API


I understand that it's probably better to lower your learning rate when it is converging.

My confusion is, can you just change the value in the config file after certain steps? If yes, which config file should I change? The one generated in train folder or the one in the downloaded model folder?

Do I need to export to frozen graph first for the changes to take effect?

Thank you in advance for helping me!


Solution

  • You have to change the the config file in the downloaded model folder. The config file in the train folder is jsut a copy from it.

    To decay the learning rate during training you can write something like this in your config file:

    optimizer {
     momentum_optimizer: {
      learning_rate: {
        manual_step_learning_rate {
          initial_learning_rate: 0.0002
          schedule {
            step: 900000
            learning_rate: .00002
          }
          schedule {
            step: 1200000
            learning_rate: .000002
          }
        }
      }
      momentum_optimizer_value: 0.9
     }
    use_moving_average: false}
    

    Have a look here for more example config files.

    With the export to a frozen graph you freeze all the parameters of your model, thus they can not be trained anymore. That is why you only freeze the graph when you finished training and want to use your model for inference.