class_docstr: The :class:`~poutyne.ModelBundle` class provides a straightforward experimentation tool for efficient and entirely
  customizable finetuning of the whole neural network training procedure with PyTorch. The
  :class:`~poutyne.ModelBundle` object takes care of the training and testing processes while also managing to keep
  traces of all pertinent information via the automatic logging option.
  
  Use ``ModelBundle.from_*`` methods to instanciate a :class:`~poutyne.ModelBundle`.
class_docstr_tok: ["The",":","class",":","`","~poutyne.ModelBundle","`","class","provides","a","straightforward","experimentation","tool","for","efficient","and","entirely","customizable","finetuning","of","the","whole","neural","network","training","procedure","with","PyTorch",".","The",":","class",":","`","~poutyne.ModelBundle","`","object","takes","care","of","the","training","and","testing","processes","while","also","managing","to","keep","traces","of","all","pertinent","information","via","the","automatic","logging","option",".","Use","``","ModelBundle.from_","*","``","methods","to","instanciate","a",":","class",":","`","~poutyne.ModelBundle","`","."]
docstr: Loads the model's weights with the weights at a given checkpoint epoch.
  
  Args:
      checkpoint (Union[int, str]): Which checkpoint to load the model's weights form.
  
          - If 'best', will load the best weights according to ``monitor_metric`` and ``monitor_mode``.
          - If 'last', will load the last model checkpoint.
          - If int, will load the checkpoint of the specified epoch.
          - If a path (str), will load the model pickled state_dict weights (for instance, saved as
            ``torch.save(a_pytorch_network.state_dict(), "./a_path.p")``).
      verbose (bool, optional): Whether or not to print the checkpoint filename, and the best epoch
          number and stats when checkpoint is 'best'.
          (Default value = False)
  
  Returns:
      If checkpoint is 'best', will return the best epoch stats, as per :func:`~get_best_epoch_stats()`,
      if checkpoint is 'last', will return the last epoch stats, if checkpoint is a int, will return the
      epoch number stats, if a path, will return the stats of that specific checkpoint.
      else None.
docstr_tok: ["Loads","the","model","'s","weights","with","the","weights","at","a","given","checkpoint","epoch",".","Args",":","checkpoint","(","Union","[","int",",","str","]",")",":","Which","checkpoint","to","load","the","model","'s","weights","form",".","-","If","'best","'",",","will","load","the","best","weights","according","to","``","monitor_metric","``","and","``","monitor_mode","``",".","-","If","'last","'",",","will","load","the","last","model","checkpoint",".","-","If","int",",","will","load","the","checkpoint","of","the","specified","epoch",".","-","If","a","path","(","str",")",",","will","load","the","model","pickled","state_dict","weights","(","for","instance",",","saved","as","``","torch.save","(","a_pytorch_network.state_dict","(",")",",","``",".\/a_path.p","''",")","``",")",".","verbose","(","bool",",","optional",")",":","Whether","or","not","to","print","the","checkpoint","filename",",","and","the","best","epoch","number","and","stats","when","checkpoint","is","'best","'",".","(","Default","value","=","False",")","Returns",":","If","checkpoint","is","'best","'",",","will","return","the","best","epoch","stats",",","as","per",":","func",":","`","~get_best_epoch_stats","(",")","`",",","if","checkpoint","is","'last","'",",","will","return","the","last","epoch","stats",",","if","checkpoint","is","a","int",",","will","return","the","epoch","number","stats",",","if","a","path",",","will","return","the","stats","of","that","specific","checkpoint",".","else","None","."]
code: def load_checkpoint(
      self,
      checkpoint: Union[int, str],
      *,
      verbose: bool = False,
      strict: bool = True,
  ) -> Union[Dict, None]:
      """
      Loads the model's weights with the weights at a given checkpoint epoch.
  
      Args:
          checkpoint (Union[int, str]): Which checkpoint to load the model's weights form.
  
              - If 'best', will load the best weights according to ``monitor_metric`` and ``monitor_mode``.
              - If 'last', will load the last model checkpoint.
              - If int, will load the checkpoint of the specified epoch.
              - If a path (str), will load the model pickled state_dict weights (for instance, saved as
                ``torch.save(a_pytorch_network.state_dict(), "./a_path.p")``).
          verbose (bool, optional): Whether or not to print the checkpoint filename, and the best epoch
              number and stats when checkpoint is 'best'.
              (Default value = False)
  
      Returns:
          If checkpoint is 'best', will return the best epoch stats, as per :func:`~get_best_epoch_stats()`,
          if checkpoint is 'last', will return the last epoch stats, if checkpoint is a int, will return the
          epoch number stats, if a path, will return the stats of that specific checkpoint.
          else None.
      """
  
      epoch_stats = None
      if isinstance(checkpoint, int):
          epoch_stats, incompatible_keys = self._load_epoch_checkpoint(
              checkpoint, verbose=verbose, strict=strict
          )
      elif checkpoint == "best":
          epoch_stats, incompatible_keys = self._load_best_checkpoint(
              verbose=verbose, strict=strict
          )
      elif checkpoint == "last":
          epoch_stats, incompatible_keys = self._load_last_checkpoint(
              verbose=verbose, strict=strict
          )
      else:
          incompatible_keys = self._load_path_checkpoint(
              path=checkpoint, verbose=verbose, strict=strict
          )
  
      if len(incompatible_keys.unexpected_keys) > 0:
          warnings.warn(
              "Unexpected key(s): "
              + ", ".join(
                  f'"{k}"' for k in incompatible_keys.unexpected_keys
              )
              + ".",
              stacklevel=2,
          )
      if len(incompatible_keys.missing_keys) > 0:
          warnings.warn(
              "Missing key(s): "
              + ", ".join(
                  f'"{k}"' for k in incompatible_keys.missing_keys
              )
              + ".",
              stacklevel=2,
          )
  
      return epoch_stats
  
imports: import os
  import warnings
  from typing import Any, Callable, Dict, List, Tuple, Union
  import torch
  from poutyne.framework.callbacks import AtomicCSVLogger, BestModelRestore, LRSchedulerCheckpoint, ModelCheckpoint, OptimizerCheckpoint, PeriodicSaveLambda, RandomStatesCheckpoint, TensorBoardLogger
  from poutyne.framework.model import Model
  from poutyne.plotting import plot_history
  from poutyne.utils import load_random_states, set_seeds
label_desc: Use image node_id 23 for calling the ModelBundle obj's underlying member method code with example usage: obj.load_checkpoint(checkpoint) and returns: epoch_stats