I think that my page in github can guide you to achieve your goal.

  
      
      GitHub
  
  
    

mortezamg63/Accessing-and-modifying-different-layers-of-a-pretrained-model-in-py... 1.0k

Contribute to Accessing-and-modifying-different-layers-of-a-pretrained-model-in-pytorch development by creating an account on GitHub.


  
  
    
    
  
  


I hope it can be helpful