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","."]
docstr: Start running.
  
  Args:
      data_loaders (list[:obj:`DataLoader`]): Dataloaders for training
          and validation.
      workflow (list[tuple]): A list of (phase, iters) to specify the
          running order and iterations. E.g, [('train', 10000),
          ('val', 1000)] means running 10000 iterations for training and
          1000 iterations for validation, iteratively.
docstr_tok: ["Start","running",".","Args",":","data_loaders","(","list","[",":","obj",":","`","DataLoader","`","]",")",":","Dataloaders","for","training","and","validation",".","workflow","(","list","[","tuple","]",")",":","A","list","of","(","phase",",","iters",")","to","specify","the","running","order","and","iterations",".","E.g",",","[","(","'train","'",",","10000",")",",","(","'val","'",",","1000",")","]","means","running","10000","iterations","for","training","and","1000","iterations","for","validation",",","iteratively","."]
code: def run(self, data_loaders, workflow, max_iters=None, **kwargs):
      """Start running.
  
      Args:
          data_loaders (list[:obj:`DataLoader`]): Dataloaders for training
              and validation.
          workflow (list[tuple]): A list of (phase, iters) to specify the
              running order and iterations. E.g, [('train', 10000),
              ('val', 1000)] means running 10000 iterations for training and
              1000 iterations for validation, iteratively.
      """
      assert isinstance(data_loaders, list)
      assert mmcv.is_list_of(workflow, tuple)
      assert len(data_loaders) == len(workflow)
      if max_iters is not None:
          warnings.warn(
              "setting max_iters in run is deprecated, "
              "please set max_iters in runner_config",
              DeprecationWarning,
          )
          self._max_iters = max_iters
      assert (
          self._max_iters is not None
      ), "max_iters must be specified during instantiation"
  
      work_dir = self.work_dir if self.work_dir is not None else "NONE"
      self.logger.info(
          "Start running, host: %s, work_dir: %s",
          get_host_info(),
          work_dir,
      )
      self.logger.info(
          "Hooks will be executed in the following order:\n%s",
          self.get_hook_info(),
      )
      self.logger.info(
          "workflow: %s, max: %d iters", workflow, self._max_iters
      )
      self.call_hook("before_run")
  
      iter_loaders = [IterLoader(x) for x in data_loaders]
  
      self.call_hook("before_epoch")
  
      while self.iter < self._max_iters:
          for i, flow in enumerate(workflow):
              self._inner_iter = 0
              mode, iters = flow
              if not isinstance(mode, str) or not hasattr(self, mode):
                  raise ValueError(
                      'runner has no method named "{}" to run a workflow'.format(
                          mode
                      )
                  )
              iter_runner = getattr(self, mode)
              for _ in range(iters):
                  if mode == "train" and self.iter >= self._max_iters:
                      break
                  iter_runner(iter_loaders[i], **kwargs)
  
      time.sleep(1)  # wait for some hooks like loggers to finish
      self.call_hook("after_epoch")
      self.call_hook("after_run")
  
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 3 for calling the IterBasedRunner obj's underlying member method code with example usage: obj.run(data_loaders, workflow, max_iters) without return types