class_docstr: Extract image feature using pretrained CNN network.
class_docstr_tok: ["Extract","image","feature","using","pretrained","CNN","network","."]
docstr: Lazily initialize preprocessor model.
  
  When image_mode is one of the ``resnet`` varieties
docstr_tok: ["Lazily","initialize","preprocessor","model",".","When","image_mode","is","one","of","the","``","resnet","``","varieties"]
code: def _init_resnet_cnn(self):
      """
      Lazily initialize preprocessor model.
  
      When image_mode is one of the ``resnet`` varieties
      """
      cnn_type, layer_num = self._image_mode_switcher()
      # initialize the pretrained CNN using pytorch.
      CNN = getattr(self.torchvision.models, cnn_type)
  
      # cut off the additional layer.
      self.netCNN = torch.nn.Sequential(
          *list(CNN(pretrained=True).children())[:layer_num]
      )
  
      if self.use_cuda:
          self.netCNN.cuda()
  
imports: import parlai.core.build_data
  import parlai.utils.logging
  from parlai.utils.io import PathManager
  import os
  from PIL import Image
  import torch
  from zipfile import ZipFile
label_desc: Use image node_id 4 for calling the ImageLoader obj's underlying member method code with example usage: obj._init_resnet_cnn() without return types