code: def load_weights(file_path, weights_type, model_name):
      weights = None
      if weights_type == "caffe2":
          weights = _load_c2_weights(file_path)
      elif weights_type == "torch":
          weights = torch.load(file_path)
          if model_name == "deepcluster":
              weights = weights["state_dict"]
          elif model_name == "rotnet":
              weights = weights["network"]
          else:
              logger.critical(
                  f"Unknown {weights_type} model: {model_name}"
              )
      else:
          logger.error("Only caffe2 and torch weights are supported")
      return weights
  
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 4 for calling a global function with example usage: load_weights(file_path, weights_type, model_name) and returns: weights