docstr: resume training:
  resume from the recorded epoch, iteration, and saved weights.
  resume from the model with the same name.
docstr_tok: ["resume","training",":","resume","from","the","recorded","epoch",",","iteration",",","and","saved","weights",".","resume","from","the","model","with","the","same","name","."]
code: def resume(self):
      """resume training:
      resume from the recorded epoch, iteration, and saved weights.
      resume from the model with the same name.
      """
      if hasattr(self.opt, "load_weights"):
          assert (
              self.opt.load_weights is None
              or self.opt.load_weights == False
          )
      # 1. load check point
      checkpoint_path = os.path.join(self.opt.out, "checkpoint.pth.tar")
      if os.path.isfile(checkpoint_path):
          checkpoint = torch.load(checkpoint_path)
      else:
          raise FileNotFoundError(
              f"model check point cannot found: {checkpoint_path}"
          )
      # 2. load data
      self.epoch = checkpoint["epoch"]
      self.iteration = checkpoint["iteration"]
      self.load_pretrained_weights()
      self.optim.load_state_dict(checkpoint["optim_state_dict"])
      utils.print_notification(
          [f"Resuming from {self.iteration} iterations"]
      )
  
imports: import os
  import math
  import time
  import random
  import tqdm
  import torch
  import torch.nn.functional
  import numpy
  import torchvision.utils
  import igl
  import lpips
  from utils import utils, render_utils, ray_utils
  from trainers import tensorboard_helper
  from options import options
  from cameras.captures import ResizedPinholeCapture
  from cameras.pinhole_camera import PinholeCamera
  from models.vanilla import weight_reset
  from utils.constant import HARD_SURFACE_OFFSET, PATCH_SIZE, PATCH_SIZE_SQUARED, CANONICAL_ZOOM_FACTOR, CANONICAL_CAMERA_DIST
label_desc: Use image node_id 18 for calling the HumanNeRFTrainer obj's underlying member method code with example usage: obj.resume() without return types