class_docstr: Container for ResNet50 s.t. it can be used for metric learning.
  The Network has been broken down to allow for higher modularity, if one wishes
  to target specific layers/blocks directly.
class_docstr_tok: ["Container","for","ResNet50","s.t",".","it","can","be","used","for","metric","learning",".","The","Network","has","been","broken","down","to","allow","for","higher","modularity",",","if","one","wishes","to","target","specific","layers\/blocks","directly","."]
code: def __init__(self, opt, list_style=False, no_norm=False):
      super(ResNet50, self).__init__()
  
      self.pars = opt
  
      if not opt.not_pretrained:
          print("Getting pretrained weights...")
          self.model = ptm.__dict__["resnet50"](
              num_classes=1000, pretrained="imagenet"
          )
          print("Done.")
      else:
          print("Not utilizing pretrained weights!")
          self.model = ptm.__dict__["resnet50"](
              num_classes=1000, pretrained=None
          )
      for module in filter(
          lambda m: type(m) == nn.BatchNorm2d, self.model.modules()
      ):
          module.eval()
          module.train = lambda _: None
  
      if opt.embed_dim != 2048:
          self.model.last_linear = torch.nn.Linear(
              self.model.last_linear.in_features, opt.embed_dim
          )
  
      self.layer_blocks = nn.ModuleList(
          [
              self.model.layer1,
              self.model.layer2,
              self.model.layer3,
              self.model.layer4,
          ]
      )
      self.loss = opt.loss
      self.feature = True
  
file_path: dgl/examples/pytorch/hilander/PSS/Smooth_AP/src/netlib.py
imports: import os
  from collections import OrderedDict
  import auxiliaries
  import pretrainedmodels
  import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new ResNet50 object from inherited base classes: nn with example: obj = ResNet50(opt, list_style, no_norm)