def METHOD_NAME(self, data: Dict) -> None:
    """Dump data to LMDB format."""
    # create lmdb env
    output_dirname = f'{self.task}_{self.split}.lmdb'
    output = osp.join(self.data_root, output_dirname)
    mmengine.mkdir_or_exist(output)
    env = lmdb.open(output, map_size=self.lmdb_map_size)
    # load data
    if 'data_list' not in data:
        raise ValueError('Dump data must have data_list key')
    data_list = data['data_list']
    cache = []
    # index start from 1
    cnt = 1
    n_samples = len(data_list)
    for d in data_list:
        # convert both images and labels to lmdb
        label_key = 'label-%09d'.encode(self.encoding) % cnt
        img_name, text = self.parser_pack_instance(d)
        img_path = osp.join(self.data_root, img_name)
        if not osp.exists(img_path):
            warnings.warn('%s does not exist' % img_path)
            continue
        with open(img_path, 'rb') as f:
            image_bin = f.read()
        if self.verify:
            if not self.check_image_is_valid(image_bin):
                warnings.warn('%s is not a valid image' % img_path)
                continue
        image_key = 'image-%09d'.encode(self.encoding) % cnt
        cache.append((image_key, image_bin))
        cache.append((label_key, text.encode(self.encoding)))
        if cnt % self.batch_size == 0:
            self.write_cache(env, cache)
            cache = []
            print('Written %d / %d' % (cnt, n_samples))
        cnt += 1
    n_samples = cnt - 1
    cache.append(('num-samples'.encode(self.encoding),
                  str(n_samples).encode(self.encoding)))
    self.write_cache(env, cache)
    print('Created lmdb dataset with %d samples' % n_samples)