code: def networkselect(opt):
      """
      Selection function for available networks.
  
      Args:
          opt: argparse.Namespace, contains all training-specific training parameters.
      Returns:
          Network of choice
      """
      if opt.arch == "resnet50":
          network = ResNet50(opt)
      else:
          raise Exception("Network {} not available!".format(opt.arch))
  
      if opt.resume:
          weights = torch.load(os.path.join(opt.save_path, opt.resume))
          weights_state_dict = weights["state_dict"]
  
          if torch.cuda.device_count() > 1:
              encoder_state_dict = OrderedDict()
              for k, v in weights_state_dict.items():
                  k = k.replace("module.", "")
                  encoder_state_dict[k] = v
  
              network.load_state_dict(encoder_state_dict)
          else:
              network.load_state_dict(weights_state_dict)
  
      # print("=================== network =======================")
      # for parameter in network.parameters():
      #     parameter.requires_grad = False
      # for parameter in network.layer_blocks[-1].parameters():
      #     parameter.requires_grad = True
  
      return network
  
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 3 for calling a global function with example usage: networkselect(opt) and returns: network