docstr: load pretrained weights from another model
docstr_tok: ["load","pretrained","weights","from","another","model"]
code: def load_pretrained_weights(self):
      """
      load pretrained weights from another model
      """
      assert os.path.isfile(
          self.opt.load_weights_path
      ), self.opt.load_weights_path
      content_list = []
      saved = torch.load(self.opt.load_weights_path, map_location="cpu")
      utils.safe_load_weights(
          self.coarse_net, saved["coarse_model_state_dict"]
      )
      content_list += [
          f"Loaded pretrained coarse_net weights from {self.opt.load_weights_path}"
      ]
      if "fine_model_state_dict" in saved and self.fine_net is not None:
          utils.safe_load_weights(
              self.fine_net, saved["fine_model_state_dict"]
          )
          content_list += [
              f"Loaded pretrained fine_net weights from {self.opt.load_weights_path}"
          ]
      utils.print_notification(content_list)
  
imports: import os
  import time
  from utils.render_utils import render_vanilla
  import tqdm
  import torch
  import torch.nn.functional
  import torchvision.utils
  import numpy
  from utils import utils, render_utils, ray_utils
  from trainers import base_trainer, tensorboard_helper
  from models.vanilla import weight_reset
label_desc: Use image node_id 11 for calling the NeRFTrainer obj's underlying member method code with example usage: obj.load_pretrained_weights() without return types