code: def __init__(
      self,
      model,
      optim_type: Optional[str] = None,
      lr_choice: Optional[str] = None,
      lr_schedule: Optional[str] = None,
      lr: Optional[float] = None,
      lr_decay: Optional[float] = None,
      end_lr: Optional[Union[float, int]] = None,
      lr_mult: Optional[Union[float, int]] = None,
      weight_decay: Optional[float] = None,
      warmup_steps: Optional[int] = None,
      validation_metric: Optional[torchmetrics.Metric] = None,
      validation_metric_name: Optional[str] = None,
      custom_metric_func: Callable = None,
      test_metric: Optional[torchmetrics.Metric] = None,
      track_grad_norm: Optional[Union[int, str]] = -1,
  ):
      super().__init__()  # TODO: inherit LitModule
      self.save_hyperparameters(
          ignore=[
              "model",
              "validation_metric",
              "test_metric",
          ]
      )
      self.model = model
      self.validation_metric = validation_metric
      self.validation_metric_name = f"val_{validation_metric_name}"
      self.use_loss = isinstance(validation_metric, BaseAggregator)
      self.id2label = self.model.id2label
      self.input_data_key = self.model.prefix + "_" + IMAGE
      self.input_label_key = self.model.prefix + "_" + LABEL
      self.track_grad_norm = track_grad_norm
  
imports: import logging
  from typing import Callable, Optional, Union
  import lightning.pytorch
  import torchmetrics
  from lightning.pytorch.utilities import grad_norm
  from torch.nn.modules.loss import _Loss
  from torchmetrics.aggregation import BaseAggregator
  from ..constants import BBOX, IMAGE, LABEL
  from .utils import apply_layerwise_lr_decay, apply_single_lr, apply_two_stages_lr, get_lr_scheduler, get_optimizer, remove_parameters_without_grad
label_desc: Use image node_id 1 to create a new MMDetLitModule object from inherited base classes: pl with example: obj = MMDetLitModule(model, optim_type, lr_choice, lr_schedule, lr, lr_decay, end_lr, lr_mult, weight_decay, warmup_steps, validation_metric, validation_metric_name, custom_metric_func, test_metric, track_grad_norm)