code: def test_model_ckpt_using_pointnet2ms(
      self,
  ):
      # Create a checkpt
  
      self.run_path = os.path.join(DIR, "checkpt")
      if not os.path.exists(self.run_path):
          os.makedirs(self.run_path)
  
      model_checkpoint = ModelCheckpoint(
          self.run_path,
          self.model_name,
          "test",
          run_config=self.config,
          resume=False,
      )
      dataset = MockDatasetGeometric(5)
      model = instantiate_model(self.config, dataset)
      model.set_input(dataset[0], "cpu")
      model.instantiate_optimizers(self.config)
  
      num_batches = 100
      num_epochs = 5
      num_samples = 3
      model.num_batches = num_batches
      model.num_epochs = num_epochs
      model.num_samples = num_samples
  
      mock_metrics = {
          "current_metrics": {"acc": 12},
          "stage": "test",
          "epoch": 10,
      }
      metric_func = {"acc": max}
      model_checkpoint.save_best_models_under_current_metrics(
          model, mock_metrics, metric_func
      )
  
      # Load checkpoint and initialize model
      model_checkpoint = ModelCheckpoint(
          self.run_path,
          self.model_name,
          "test",
          self.config,
          resume=True,
      )
      model2 = model_checkpoint.create_model(dataset, weight_name="acc")
  
      self.assertEqual(
          str(model.optimizer.__class__.__name__),
          str(model2.optimizer.__class__.__name__),
      )
  
      self.assertEqual(model2.num_batches, num_batches)
      self.assertEqual(model2.num_epochs, num_epochs)
      self.assertEqual(model2.num_samples, num_samples)
      self.assertEqual(
          model.optimizer.defaults, model2.optimizer.defaults
      )
      self.assertEqual(
          model.schedulers["lr_scheduler"].state_dict(),
          model2.schedulers["lr_scheduler"].state_dict(),
      )
      self.assertEqual(
          model.schedulers["bn_scheduler"].state_dict(),
          model2.schedulers["bn_scheduler"].state_dict(),
      )
  
      remove(os.path.join(ROOT, "{}.pt".format(self.model_name)))
      remove(os.path.join(DIR, "{}.pt".format(self.model_name)))
  
imports: import unittest
  import omegaconf
  from omegaconf import OmegaConf, DictConfig
  import os
  import sys
  import hydra
  import shutil
  import torch
  from mockdatasets import MockDatasetGeometric
  from torch_points3d.models.model_factory import instantiate_model
  from torch_points3d.utils.model_building_utils.model_definition_resolver import resolve_model
  from torch_points3d.metrics.model_checkpoint import ModelCheckpoint
label_desc: Use image node_id 2 for calling the TestModelCheckpoint obj's underlying member method code with example usage: obj.test_model_ckpt_using_pointnet2ms() without return types