code: def load_pretrain_weight(model, pretrain_weight, ARSL_eval=False):
      if is_url(pretrain_weight):
          pretrain_weight = get_weights_path(pretrain_weight)
  
      path = _strip_postfix(pretrain_weight)
      if not (
          os.path.isdir(path)
          or os.path.isfile(path)
          or os.path.exists(path + ".pdparams")
      ):
          raise ValueError(
              "Model pretrain path `{}` does not exists. "
              "If you don't want to load pretrain model, "
              "please delete `pretrain_weights` field in "
              "config file.".format(path)
          )
      teacher_student_flag = False
      if not ARSL_eval:
          if hasattr(model, "modelTeacher") and hasattr(
              model, "modelStudent"
          ):
              print(
                  "Loading pretrain weights for Teacher-Student framework."
              )
              print(
                  "Assert Teacher model has the same structure with Student model."
              )
              model_dict = model.modelStudent.state_dict()
              teacher_student_flag = True
          else:
              model_dict = model.state_dict()
  
          weights_path = path + ".pdparams"
          param_state_dict = paddle.load(weights_path)
          param_state_dict = match_state_dict(
              model_dict, param_state_dict
          )
          for k, v in param_state_dict.items():
              if isinstance(v, np.ndarray):
                  v = paddle.to_tensor(v)
              if model_dict[k].dtype != v.dtype:
                  param_state_dict[k] = v.astype(model_dict[k].dtype)
  
          if teacher_student_flag:
              model.modelStudent.set_dict(param_state_dict)
              model.modelTeacher.set_dict(param_state_dict)
          else:
              model.set_dict(param_state_dict)
          logger.info(
              "Finish loading model weights: {}".format(weights_path)
          )
  
      else:
          weights_path = path + ".pdparams"
          param_state_dict = paddle.load(weights_path)
          student_model_dict = model.modelStudent.state_dict()
          student_param_state_dict = match_state_dict(
              student_model_dict, param_state_dict, mode="student"
          )
          model.modelStudent.set_dict(student_param_state_dict)
          print("Loading pretrain weights for Teacher model.")
          teacher_model_dict = model.modelTeacher.state_dict()
  
          teacher_param_state_dict = match_state_dict(
              teacher_model_dict, param_state_dict, mode="teacher"
          )
          model.modelTeacher.set_dict(teacher_param_state_dict)
          logger.info(
              "Finish loading model weights: {}".format(weights_path)
          )
  
file_path: PaddleDetection/ppdet/utils/checkpoint.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import numpy
  import paddle
  import paddle.nn
  from .download import get_weights_path
  from .logger import setup_logger
label_desc: Use image node_id 5 for calling a global function with example usage: load_pretrain_weight(model, pretrain_weight, ARSL_eval) without return types