class_docstr: Logs a validation batch and their predictions to wandb.
  Example adapted from:
      https://wandb.ai/wandb/wandb-lightning/reports/Image-Classification-using-PyTorch-Lightning--VmlldzoyODk1NzY
class_docstr_tok: ["Logs","a","validation","batch","and","their","predictions","to","wandb",".","Example","adapted","from",":","https",":","\/\/wandb.ai\/wandb\/wandb-lightning\/reports\/Image-Classification-using-PyTorch-Lightning","--","VmlldzoyODk1NzY"]
code: def on_validation_epoch_end(self, trainer, pl_module):
      if self.ready:
          logger = get_wandb_logger(trainer=trainer)
          experiment = logger.experiment
  
          # get a validation batch from the validation dat loader
          val_samples = next(iter(trainer.datamodule.val_dataloader()))
          val_imgs, val_labels = val_samples
  
          # run the batch through the network
          val_imgs = val_imgs.to(device=pl_module.device)
          logits = pl_module(val_imgs)
          preds = torch.argmax(logits, dim=-1)
  
          # log the images as wandb Image
          experiment.log(
              {
                  f"Images/{experiment.name}": [
                      wandb.Image(x, caption=f"Pred:{pred}, Label:{y}")
                      for x, pred, y in zip(
                          val_imgs[: self.num_samples],
                          preds[: self.num_samples],
                          val_labels[: self.num_samples],
                      )
                  ]
              }
          )
  
imports: import subprocess
  from pathlib import Path
  from typing import List
  import matplotlib.pyplot
  import seaborn
  import torch
  import wandb
  from pytorch_lightning import Callback, Trainer
  from pytorch_lightning.loggers import LoggerCollection, WandbLogger
  from pytorch_lightning.utilities import rank_zero_only
  from sklearn import metrics
  from sklearn.metrics import f1_score, precision_score, recall_score
label_desc: Use image node_id 4 for calling the LogImagePredictions obj's underlying member method code with example usage: obj.on_validation_epoch_end(trainer, pl_module) without return types