code: def _resnet_features(model: nn.Module, out_channels: int):
      # remove last layer (fully-connected)
      modules = list(model.named_children())[:-2]
      features = nn.Sequential(OrderedDict(modules))
  
      features.out_channels = out_channels
      features.param_groups = MethodType(resnet_param_groups, features)
  
      return features
  
file_path: icevision/icevision/models/fastai/unet/backbones/resnet_configs.py
imports: from collections import OrderedDict
  from types import MethodType
  from typing import List
  from torch import nn
  import torchvision
  from icevision.utils.torch_utils import check_all_model_params_in_groups2
  from icevision.models.fastai.unet.backbones.backbone_config import TorchvisionUNetBackboneConfig
label_desc: Use image node_id 1 for calling a global function with example usage: _resnet_features(model, out_channels) and returns: features