class_docstr: Memory profiler hook recording memory information including virtual
  memory, swap memory, and the memory of the current process.
  
  Args:
      interval (int): Checking interval (every k iterations).
          Default: 50.
class_docstr_tok: ["Memory","profiler","hook","recording","memory","information","including","virtual","memory",",","swap","memory",",","and","the","memory","of","the","current","process",".","Args",":","interval","(","int",")",":","Checking","interval","(","every","k","iterations",")",".","Default",":","50","."]
code: def __init__(self, interval: int = 50) -> None:
      try:
          from psutil import swap_memory, virtual_memory
  
          self._swap_memory = swap_memory
          self._virtual_memory = virtual_memory
      except ImportError:
          raise ImportError(
              "psutil is not installed, please install it by: "
              "pip install psutil"
          )
  
      try:
          from memory_profiler import memory_usage
  
          self._memory_usage = memory_usage
      except ImportError:
          raise ImportError(
              "memory_profiler is not installed, please install it by: "
              "pip install memory_profiler"
          )
  
      self.interval = interval
  
file_path: mmdetection/mmdet/engine/hooks/memory_profiler_hook.py
imports: from typing import Optional, Sequence
  from mmengine.hooks import Hook
  from mmengine.runner import Runner
  from mmdet.registry import HOOKS
  from mmdet.structures import DetDataSample
label_desc: Use image node_id 1 to create a new MemoryProfilerHook object from inherited base classes: Hook with example: obj = MemoryProfilerHook(interval)