code: def init_weights(
      self,
      pretrained="",
  ):
      logger.info("=> init weights from normal distribution")
      for name, m in self.named_modules():
          if any(part in name for part in {"cls", "aux", "ocr"}):
              # print('skipped', name)
              continue
          if isinstance(m, nn.Conv2d):
              nn.init.normal_(m.weight, std=0.001)
          elif isinstance(m, BatchNorm2d_class):
              nn.init.constant_(m.weight, 1)
              nn.init.constant_(m.bias, 0)
      if os.path.isfile(pretrained):
          pretrained_dict = torch.load(
              pretrained, map_location={"cuda:0": "cpu"}
          )
          logger.info(
              "=> loading pretrained model {}".format(pretrained)
          )
          model_dict = self.state_dict()
          pretrained_dict = {
              k.replace("last_layer", "aux_head").replace(
                  "model.", ""
              ): v
              for k, v in pretrained_dict.items()
          }
          print(set(model_dict) - set(pretrained_dict))
          print(set(pretrained_dict) - set(model_dict))
          pretrained_dict = {
              k: v
              for k, v in pretrained_dict.items()
              if k in model_dict.keys()
          }
          # for k, _ in pretrained_dict.items():
          # logger.info(
          #     '=> loading {} pretrained model {}'.format(k, pretrained))
          model_dict.update(pretrained_dict)
          self.load_state_dict(model_dict)
      elif pretrained:
          raise RuntimeError("No such file {}".format(pretrained))
  
imports: import os
  import logging
  import numpy
  import torch
  import torch.nn
  import torch._utils
  import torch.nn.functional
  from .bn_helper import BatchNorm2d, BatchNorm2d_class, relu_inplace
label_desc: Use image node_id 6 for calling the HighResolutionNet obj's underlying member method code with example usage: obj.init_weights(pretrained) without return types