code: def convert(in_file, out_file):
      checkpoint = torch.load(in_file)
      in_state_dict = checkpoint.pop("state_dict")
      out_state_dict = OrderedDict()
      meta_info = checkpoint["meta"]
      parse_config("#" + meta_info["config"])
      for key, value in in_state_dict.items():
          if "extra" in key:
              layer_idx = int(key.split(".")[2])
              new_key = (
                  "neck.extra_layers.{}.{}.conv.".format(
                      layer_idx // 2, layer_idx % 2
                  )
                  + key.split(".")[-1]
              )
          elif "l2_norm" in key:
              new_key = "neck.l2_norm.weight"
          elif "bbox_head" in key:
              new_key = key[:21] + ".0" + key[21:]
          else:
              new_key = key
          out_state_dict[new_key] = value
      checkpoint["state_dict"] = out_state_dict
  
      if digit_version(torch.__version__) >= digit_version("1.6"):
          torch.save(
              checkpoint, out_file, _use_new_zipfile_serialization=False
          )
      else:
          torch.save(checkpoint, out_file)
  
file_path: mmdetection/tools/model_converters/upgrade_ssd_version.py
imports: import argparse
  import tempfile
  from collections import OrderedDict
  import torch
  from mmengine import Config
  from mmengine.utils import digit_version
label_desc: Use image node_id 2 for calling a global function with example usage: convert(in_file, out_file) without return types