BaseFinetuning Callback freeze_before_training is never called
🐛 Bug

I think there might be a bug in the implementation of the BaseFinetuning callback, and in particular in the following lines:

  
    
      pytorch-lightning/pytorch_lightning/callbacks/finetuning.py
    
    
        Lines 236 to 237
      in
      a028171
    
  
  
    

        
          
           def on_before_accelerator_backend_setup(self, trainer, pl_module): 
        

        
          
               self.freeze_before_training(pl_module) 
        
    
  


freeze_before_training is meant to be over-riden by child classes so that the freezing logic is implemented before the start of training. However, the call to this method happens using the on_before_accelerator_backend_setup hook. I am not sure where this hook has come from as I was unable to find it in the latest version of the documentation:
Testing the callback using the MilestonesFinetuningCallback from the related example resulted in the layers not being freezed before training.
To make this work, I had to change the callback hook that freeze_before_training is called to on_pretrain_routine_start.
Apologies I wasn't able to provide a piece of code to reproduce this issue.
On a separate note, the MilestonesFinetuningCallback in the example uses wrong signatures:

  
    
      pytorch-lightning/pl_examples/domain_templates/computer_vision_fine_tuning.py
    
    
         Line 72
      in
      a028171
    
  
  
    

        
          
           self.freeze(module=pl_module.feature_extractor, train_bn=self.train_bn) 
        
    
  


here module should be modules to match the signature of the freeze method of the parent class:

  
    
      pytorch-lightning/pytorch_lightning/callbacks/finetuning.py
    
    
         Line 147
      in
      a028171
    
  
  
    

        
          
           def freeze(modules: Union[Module, Iterable[Union[Module, Iterable]]], train_bn: bool = True) -> None: 
        
    
  


Same applies to unfreeze_and_add_param_group:

  
    
      pytorch-lightning/pl_examples/domain_templates/computer_vision_fine_tuning.py
    
    
        Lines 77 to 79
      in
      a028171
    
  
  
    

        
          
           self.unfreeze_and_add_param_group( 
        

        
          
               module=pl_module.feature_extractor[-5:], optimizer=optimizer, train_bn=self.train_bn 
        

        
          
           ) 
        
    
  


and

  
    
      pytorch-lightning/pl_examples/domain_templates/computer_vision_fine_tuning.py
    
    
        Lines 83 to 84
      in
      a028171
    
  
  
    

        
          
           self.unfreeze_and_add_param_group( 
        

        
          
               module=pl_module.feature_extractor[:-5], optimizer=optimizer, train_bn=self.train_bn 
        
    
  


Compare to:

  
    
      pytorch-lightning/pytorch_lightning/callbacks/finetuning.py
    
    
        Lines 197 to 198
      in
      a028171
    
  
  
    

        
          
           def unfreeze_and_add_param_group( 
        

        
          
               modules: Union[Module, Iterable[Union[Module, Iterable]]], 
        
    
  


Please reproduce using the BoringModel

Bug is in branch release/1.2-dev so I wouldn't be able to reproduce using  pip installation.
## Environment

PyTorch Version (e.g., 1.0): 1.6.0+cu101
OS (e.g., Linux): Linux
How you installed PyTorch (conda, pip, source): pip
Build command you used (if compiling from source):
Python version: 3.7.7
CUDA/cuDNN version: 10.1
GPU models and configuration:  4 X GeForce GTX 1080 Ti
Any other relevant information:

Additional context
Happy to submit a PR to fix these issues.