class_docstr: Args:
      plan_path (int): The plan path of nnunet.
      num_classes (int): Only for comparative with other models, this param has no function. Default: 0.
      pretrained (str | optional): The path or url of pretrained model. Default: None.
      stage (int | optional): The stage of nnunet, 0 for nnunet_2d and nnunet_3d, 1 for nnunet_cascade stage 2. Default: None.
      cascade (bool | optional): Whether is cascade model. Default: False.
      deep_supervision (bool | optional): Whether return multi-scale feats when training mode. Default: True.
      feat_map_mul_on_downscale (int | optional): The expansion ratio of stage channels. Defatult: 2.
      use_dropout (bool | optional): Whether use dropout layer in model. Default: False.
      upscale_logits (bool | optional): Whether upscale output feats with different resolutions to the same resolution. Defatult: False.
      convolutional_pooling (bool | optional): Whether add pool layer after conv layer. If convolutional_pooling is True, only conv layer is used and reduce resolution by conv stride. Default: False.
      convolutional_upsampling (bool | optional): Use transpose conv layer or interpolate to upsample feature maps. If True, using transpose conv. Default: False.
class_docstr_tok: ["Args",":","plan_path","(","int",")",":","The","plan","path","of","nnunet",".","num_classes","(","int",")",":","Only","for","comparative","with","other","models",",","this","param","has","no","function",".","Default",":","0.","pretrained","(","str","|","optional",")",":","The","path","or","url","of","pretrained","model",".","Default",":","None",".","stage","(","int","|","optional",")",":","The","stage","of","nnunet",",","0","for","nnunet_2d","and","nnunet_3d",",","1","for","nnunet_cascade","stage","2",".","Default",":","None",".","cascade","(","bool","|","optional",")",":","Whether","is","cascade","model",".","Default",":","False",".","deep_supervision","(","bool","|","optional",")",":","Whether","return","multi-scale","feats","when","training","mode",".","Default",":","True",".","feat_map_mul_on_downscale","(","int","|","optional",")",":","The","expansion","ratio","of","stage","channels",".","Defatult",":","2.","use_dropout","(","bool","|","optional",")",":","Whether","use","dropout","layer","in","model",".","Default",":","False",".","upscale_logits","(","bool","|","optional",")",":","Whether","upscale","output","feats","with","different","resolutions","to","the","same","resolution",".","Defatult",":","False",".","convolutional_pooling","(","bool","|","optional",")",":","Whether","add","pool","layer","after","conv","layer",".","If","convolutional_pooling","is","True",",","only","conv","layer","is","used","and","reduce","resolution","by","conv","stride",".","Default",":","False",".","convolutional_upsampling","(","bool","|","optional",")",":","Use","transpose","conv","layer","or","interpolate","to","upsample","feature","maps",".","If","True",",","using","transpose","conv",".","Default",":","False","."]
code: def __init__(
      self,
      plan_path,
      num_classes=0,
      pretrained=None,
      stage=None,
      cascade=False,
      deep_supervision=True,
      feat_map_mul_on_downscale=2,
      use_dropout=False,
      upscale_logits=False,
      convolutional_pooling=True,
      convolutional_upsampling=True,
  ):
      super().__init__()
      self.plan_path = plan_path
      self.stage = stage
      self.cascade = cascade
      self.load_and_process_plan_file(plan_path)
  
      if self.threeD:
          conv_op = nn.Conv3D
          dropout_op = nn.Dropout3D
          norm_op = nn.InstanceNorm3D
          max_num_features = experiment_planner.MAX_NUM_FILTERS_3D
      else:
          conv_op = nn.Conv2D
          dropout_op = nn.Dropout2D
          norm_op = nn.InstanceNorm2D
          max_num_features = experiment_planner.MAX_FILTERS_2D
  
      norm_op_kwargs = {"epsilon": 1e-5}
      dropout_op_kwargs = {"p": 0}
      net_nonlin = nn.LeakyReLU
      net_nonlin_kwargs = {"negative_slope": 1e-2}
      self.network = Generic_UNet(
          input_channels=self.num_input_channels,
          base_num_features=self.base_num_features,
          num_classes=self.num_classes,
          num_pool=len(self.net_num_pool_op_kernel_sizes),
          num_conv_per_stage=self.conv_per_stage,
          feat_map_mul_on_downscale=feat_map_mul_on_downscale,
          conv_op=conv_op,
          norm_op=norm_op,
          norm_op_kwargs=norm_op_kwargs,
          dropout_op=dropout_op,
          dropout_op_kwargs=dropout_op_kwargs,
          nonlin=net_nonlin,
          nonlin_kwargs=net_nonlin_kwargs,
          deep_supervision=deep_supervision,
          use_dropout=use_dropout,
          pool_op_kernel_sizes=self.net_num_pool_op_kernel_sizes,
          conv_kernel_sizes=self.net_conv_kernel_sizes,
          upscale_logits=upscale_logits,
          convolutional_pooling=convolutional_pooling,
          convolutional_upsampling=convolutional_upsampling,
          max_num_features=max_num_features,
      )
  
      self.pretrained = pretrained
      self.init_weight()
  
imports: import os
  import sys
  import pickle
  import numpy
  from copy import deepcopy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from medicalseg.cvlibs import manager
  from medicalseg.utils import utils
  from medicalseg.cvlibs import param_init
  from medicalseg.models import layers
  from tools.preprocess_utils import experiment_planner
label_desc: Use image node_id 1 to create a new NNUNet object from inherited base classes: nn with example: obj = NNUNet(plan_path, num_classes, pretrained, stage, cascade, deep_supervision, feat_map_mul_on_downscale, use_dropout, upscale_logits, convolutional_pooling, convolutional_upsampling)