code: def se_inception_i3d(
      name,
      num_channels,
      num_classes,
      attention,
      pretrained=False,
      progress=True,
      rgb=True,
  ):
      """Get InceptionI3d module w/o SELayer and pretrained model."""
      if rgb:
          model = SEInceptionI3DRGB(
              num_channels, num_classes, attention
          )
      else:
          model = SEInceptionI3DFlow(
              num_channels, num_classes, attention
          )
  
      if pretrained:
          state_dict = load_state_dict_from_url(
              model_urls[name], progress=progress
          )
  
          # delete the last layer's parameter and only load the parameters before the last due to different class number.
          # uncomment and change the output size of I3D when using the default classifier in I3D.
  
          # state_dict.pop("logits.conv3d.weight")
          # state_dict.pop("logits.conv3d.bias")
          # model.load_state_dict(state_dict, strict=False)
  
          # Create new OrderedDict that add `model.`
          from collections import OrderedDict
  
          new_state_dict = OrderedDict()
          for k, v in state_dict.items():
              name = "model.{}".format(k)
              new_state_dict[name] = v
  
          # Load params except SELayer
          model.load_state_dict(new_state_dict, strict=False)
      return model
  
file_path: pykale/kale/embed/video_se_i3d.py
imports: import torch.nn
  from torch.hub import load_state_dict_from_url
  from kale.embed.video_i3d import InceptionI3d
  from kale.embed.video_selayer import get_selayer, SELayerC, SELayerT
label_desc: Use image node_id 1 for calling a global function with example usage: se_inception_i3d(name, num_channels, num_classes, attention, pretrained, progress, rgb) and returns: model