class_docstr: The DeepLabV2 implementation based on PaddlePaddle.
  
  The original article refers to:
      Chen, L. C., Papandreou, G., Kokkinos, I., Murphy, K., & Yuille, A. L. (2017). Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence, 40(4), 834-848.
  
  Args:
      backbone (paddle.nn.Layer): Backbone network, currently support Resnet101.
      align_corners (bool, optional): An argument of F.interpolate. It should be set to False when the feature size is even,
          e.g. 1024x512, otherwise it is True, e.g. 769x769. Default: False.
      pretrained (str, optional): The path or url of pretrained model. Default: None.
      data_format(str, optional): Data format that specifies the layout of input. It can be "NCHW" or "NHWC". Default: "NCHW".
class_docstr_tok: ["The","DeepLabV2","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to",":","Chen",",","L.","C.",",","Papandreou",",","G.",",","Kokkinos",",","I.",",","Murphy",",","K.",",","&","Yuille",",","A.","L.","(","2017",")",".","Deeplab",":","Semantic","image","segmentation","with","deep","convolutional","nets",",","atrous","convolution",",","and","fully","connected","crfs",".","IEEE","transactions","on","pattern","analysis","and","machine","intelligence",",","40","(","4",")",",","834-848",".","Args",":","backbone","(","paddle.nn.Layer",")",":","Backbone","network",",","currently","support","Resnet101",".","align_corners","(","bool",",","optional",")",":","An","argument","of","F.interpolate",".","It","should","be","set","to","False","when","the","feature","size","is","even",",","e.g",".","1024x512",",","otherwise","it","is","True",",","e.g",".","769x769",".","Default",":","False",".","pretrained","(","str",",","optional",")",":","The","path","or","url","of","pretrained","model",".","Default",":","None",".","data_format","(","str",",","optional",")",":","Data","format","that","specifies","the","layout","of","input",".","It","can","be","``","NCHW","''","or","``","NHWC","''",".","Default",":","``","NCHW","''","."]
code: def init_weight(self):
      if self.pretrained is not None:
          para_state_dict = paddle.load(self.pretrained)
          model_state_dict = self.backbone.state_dict()
          keys = model_state_dict.keys()
          num_params_loaded = 0
          for k in keys:
              k_parts = k.split(".")
              torchkey = "backbone." + k
              if k_parts[1] == "layer5":
                  logger.warning("{} should not be loaded".format(k))
              elif torchkey not in para_state_dict:
                  logger.warning(
                      "{} is not in pretrained model".format(k)
                  )
              elif list(para_state_dict[torchkey].shape) != list(
                  model_state_dict[k].shape
              ):
                  logger.warning(
                      "[SKIP] Shape of pretrained params {} doesn't match.(Pretrained: {}, Actual: {})".format(
                          k,
                          para_state_dict[torchkey].shape,
                          model_state_dict[k].shape,
                      )
                  )
              else:
                  model_state_dict[k] = para_state_dict[torchkey]
                  num_params_loaded += 1
          self.backbone.set_dict(model_state_dict)
          logger.info(
              "There are {}/{} variables loaded into {}.".format(
                  num_params_loaded,
                  len(model_state_dict),
                  self.backbone.__class__.__name__,
              )
          )
  
file_path: PaddleSeg/contrib/DomainAdaptation/models/deeplabv2.py
imports: import os
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
  from paddleseg.models import layers
  from paddleseg.models.backbones import resnet_vd
  from paddleseg.utils import utils, logger
  from .gscnn import GSCNNHead
  from .backbones.resnet import ClassifierModule
label_desc: Use image node_id 3 for calling the DeepLabV2 obj's underlying member method code with example usage: obj.init_weight() without return types