code: def test_init(self):
      with self.assertRaises(AssertionError):
          F1Metric(num_classes="3")
  
      with self.assertRaises(AssertionError):
          F1Metric(
              num_classes=3, ignored_classes=[1], cared_classes=[0]
          )
  
      with self.assertRaises(AssertionError):
          F1Metric(num_classes=3, ignored_classes=1)
  
      with self.assertRaises(AssertionError):
          F1Metric(num_classes=2, mode=1)
  
      with self.assertRaises(AssertionError):
          F1Metric(num_classes=1, mode="1")
  
file_path: mmocr/tests/test_evaluation/test_metrics/test_f_metric.py
imports: import unittest
  import torch
  from mmengine.structures import InstanceData
  from mmocr.evaluation import F1Metric
  from mmocr.structures import KIEDataSample
label_desc: Use image node_id 1 for calling the TestF1Metric obj's underlying member method code with example usage: obj.test_init() without return types