code: def init_from_ckpt(self, path, ignore_keys=None):
      sd = torch.load(path, map_location="cpu")["state_dict"]
      keys = list(sd.keys())
      for k in keys:
          for ik in ignore_keys or []:
              if k.startswith(ik):
                  print("Deleting key {} from state_dict.".format(k))
                  del sd[k]
      missing, unexpected = self.load_state_dict(sd, strict=False)
      print(
          f"Restored from {path} with {len(missing)} missing and {len(unexpected)} unexpected keys"
      )
      if missing:
          print(f"Missing Keys: {missing}")
      if unexpected:
          print(f"Unexpected Keys: {unexpected}")
  
imports: import numpy
  import torch
  import pytorch_lightning
  import torch.nn.functional
  from contextlib import contextmanager
  from torch.optim.lr_scheduler import LambdaLR
  from ldm.modules.ema import LitEma
  from vqvae_quantize import VectorQuantizer2
  from ldm.modules.diffusionmodules.model import Encoder, Decoder
  from ldm.util import instantiate_from_config
  import ldm.models.autoencoder
  from packaging import version
label_desc: Use image node_id 3 for calling the VQModel obj's underlying member method code with example usage: obj.init_from_ckpt(path, ignore_keys) without return types