code: def load_model_train_lightcnn(model, pretrained):
      weights = torch.load(pretrained)
      pretrained_dict = weights["state_dict"]
      model_dict = model.state_dict()
  
      # print("to here")
      # print(model_dict.keys())
      # print('\n')
  
      # print(pretrained_dict.keys())
  
      # import pdb;pdb.set_trace()
  
      pretrained_dict = {
          k: v
          for k, v in pretrained_dict.items()
          if k in model_dict and "module.weight" not in k
      }
  
      print("len of params to be loaded: ", len(pretrained_dict))
      model.load_state_dict(pretrained_dict, strict=False)
  
      return weights["epoch"]
  
file_path: insightface/recognition/idmmd/utils.py
imports: import os
  import numpy
  import torch
  import torch.nn.functional
label_desc: Use image node_id 7 for calling a global function with example usage: load_model_train_lightcnn(model, pretrained) and returns: weights