code: def main():
      parser = argparse.ArgumentParser(
          description="Convert AlexNet model to Pytorch"
      )
      parser.add_argument(
          "--input_model_weights",
          type=str,
          default=None,
          help="Path to input model weights to be converted",
      )
      parser.add_argument(
          "--output_model",
          type=str,
          default=None,
          help="Path to save torch RN-50 model",
      )
      parser.add_argument(
          "--bgr2rgb",
          dest="bgr2rgb",
          default=False,
          help="Revert bgr (openCV) order to rgb (PIL) order",
      )
      parser.add_argument(
          "--model_name",
          type=str,
          required=True,
          help="jigsaw | colorization | supervised | rotnet | deepcluster",
      )  # NOQA
      parser.add_argument(
          "--weights_type",
          type=str,
          required=True,
          help="caffe2 | torch",
      )
      args = parser.parse_args()
  
      # load the input model weights
      logger.info("Loading weights...")
      state_dict = load_weights(
          args.input_model_weights, args.weights_type, args.model_name
      )
  
      # for the pretext model from jigsaw, special processing
      if args.model_name == "jigsaw":
          state_dict = remove_jigsaw_names(state_dict)
  
      # depending on the image reading library, we convert the weights to be
      # compatible order. The default order of caffe2 weights is BGR (openCV).
      if args.bgr2rgb:
          state_dict = convert_bgr2rgb(state_dict)
  
      state_dict = _rename_weights_for_alexnet(
          state_dict, args.weights_type, args.model_name
      )
      state = {"model_state_dict": state_dict}
      logger.info(
          "Saving converted weights to: {}".format(args.output_model)
      )
      torch.save(state, args.output_model)
      logger.info("Done!!")
  
file_path: vissl/extra_scripts/convert_caffe2_to_vissl_alexnet.py
imports: import argparse
  import logging
  import pickle
  import sys
  from collections import OrderedDict
  import numpy
  import torch
  from iopath.common.file_io import g_pathmgr
label_desc: Use image node_id 9 for calling a global function with example usage: main() without return types