class_docstr: Callback for saving model topology, losses & metrics.
  
  Optionally logs weights, gradients, sample predictions and best trained model.
  
  Arguments:
      learn (fastai.basic_train.Learner): the fast.ai learner to hook.
      log (str): "gradients", "parameters", "all", or None. Losses & metrics are always logged.
      save_model (bool): save model at the end of each epoch. It will also load best model at the end of training.
      monitor (str): metric to monitor for saving best model. None uses default TrackerCallback monitor value.
      mode (str): "auto", "min" or "max" to compare "monitor" values and define best model.
      input_type (str): "images" or None. Used to display sample predictions.
      validation_data (list): data used for sample predictions if input_type is set.
      predictions (int): number of predictions to make if input_type is set and validation_data is None.
      seed (int): initialize random generator for sample predictions if input_type is set and validation_data is None.
docstr: Load the best model.
docstr_tok: ["Load","the","best","model","."]
code: def on_train_end(self, **kwargs: Any) -> None:
      """Load the best model."""
      if self.save_model:
          # Adapted from fast.ai "SaveModelCallback"
          if self.model_path.is_file():
              with self.model_path.open("rb") as model_file:
                  self.learn.load(model_file, purge=False)
                  print(
                      f"Loaded best saved model from {self.model_path}"
                  )
  
file_path: wandb/wandb/integration/fastai/__init__.py
imports: import random
  import sys
  from pathlib import Path
  from typing import Any, Optional
  import fastai
  from fastai.callbacks import TrackerCallback
  import wandb
label_desc: Use image node_id 4 for calling the WandbCallback obj's underlying member method code with example usage: obj.on_train_end() without return types