class_docstr: Iteration-based Runner.
  
  This runner train models iteration by iteration.
class_docstr_tok: ["Iteration-based","Runner",".","This","runner","train","models","iteration","by","iteration","."]
code: def val(self, data_loader, **kwargs):
      self.model.eval()
      self.mode = "val"
      self.data_loader = data_loader
      data_batch = next(data_loader)
      self.call_hook("before_val_iter")
      outputs = self.model.val_step(data_batch, **kwargs)
      if not isinstance(outputs, dict):
          raise TypeError("model.val_step() must return a dict")
      if "log_vars" in outputs:
          self.log_buffer.update(
              outputs["log_vars"], outputs["num_samples"]
          )
      self.outputs = outputs
      self.call_hook("after_val_iter")
      self._inner_iter += 1
  
imports: import os.path
  import platform
  import shutil
  import time
  import warnings
  import torch
  from torch.optim import Optimizer
  import annotator.uniformer.mmcv
  from .base_runner import BaseRunner
  from .builder import RUNNERS
  from .checkpoint import save_checkpoint
  from .hooks import IterTimerHook
  from .utils import get_host_info
label_desc: Use image node_id 2 for calling the IterBasedRunner obj's underlying member method code with example usage: obj.val(data_loader) without return types