Created
          June 11, 2019 19:56 
        
      - 
      
- 
        Save abhishekkrthakur/c97804590505bf75630f7cc72707206e to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import torch.nn as nn | |
| import pretrainedmodels as pm | |
| model = pm.__dict__["resnet50"](pretrained='imagenet') | |
| model.avg_pool = nn.AdaptiveAvgPool2d(1) | |
| model.last_linear = nn.Sequential( | |
| nn.BatchNorm1d(2048), | |
| nn.Dropout(p=0.25), | |
| nn.Linear(in_features=2048, out_features=2048), | |
| nn.ReLU(), | |
| nn.BatchNorm1d(2048, eps=1e-05, momentum=0.1), | |
| nn.Dropout(p=0.5), | |
| nn.Linear(in_features=2048, out_features=1103), | |
| ) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment