docstr: Creates a new checkpoint object in the current working directory by loading the
  checkpoint located at [checkpointdir]/[checkpoint_name].pt
docstr_tok: ["Creates","a","new","checkpoint","object","in","the","current","working","directory","by","loading","the","checkpoint","located","at","[","checkpointdir","]","\/","[","checkpoint_name","]",".pt"]
code: def load(
      checkpoint_dir: str,
      checkpoint_name: str,
      run_config: Any,
      strict=False,
      resume=True,
  ):
      """Creates a new checkpoint object in the current working directory by loading the
      checkpoint located at [checkpointdir]/[checkpoint_name].pt
      """
      checkpoint_file = (
          os.path.join(checkpoint_dir, checkpoint_name) + ".pt"
      )
      if not os.path.exists(checkpoint_file):
          ckp = Checkpoint(checkpoint_file)
          if strict or resume:
              available_checkpoints = glob.glob(
                  os.path.join(checkpoint_dir, "*.pt")
              )
              message = "The provided path {} didn't contain the checkpoint_file {}".format(
                  checkpoint_dir, checkpoint_name + ".pt"
              )
              if available_checkpoints:
                  message += "\nDid you mean {}?".format(
                      os.path.basename(available_checkpoints[0])
                  )
              raise ValueError(message)
          ckp.run_config = run_config
          return ckp
      else:
          chkp_name = os.path.basename(checkpoint_file)
          if resume:
              shutil.copyfile(
                  checkpoint_file, chkp_name
              )  # Copy checkpoint to new run directory to make sure we don't override
          ckp = Checkpoint(chkp_name)
          log.info("Loading checkpoint from {}".format(checkpoint_file))
          objects = torch.load(checkpoint_file, map_location="cpu")
          for key, value in objects.items():
              setattr(ckp, key, value)
          ckp._filled = True
      return ckp
  
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  import os
  import torch
  import logging
  import copy
  import glob
  import shutil
  from omegaconf import OmegaConf
  from omegaconf import DictConfig
  from torch_points3d.models import model_interface
  from torch_points3d.utils.colors import COLORS, colored_print
  from torch_points3d.core.schedulers.lr_schedulers import instantiate_scheduler
  from torch_points3d.core.schedulers.bn_schedulers import instantiate_bn_scheduler
  from torch_points3d.models.model_factory import instantiate_model
label_desc: Use image node_id 4 for calling the Checkpoint obj's underlying member method code with example usage: obj.load(checkpoint_dir, checkpoint_name, run_config, strict, resume) and returns: ckp, ckp