tensorflow/models · error · ValueError

Unrecognized init_checkpoint_type: %s

Error message

Unrecognized init_checkpoint_type: %s

What it means

Error "Unrecognized init_checkpoint_type: %s" thrown in tensorflow/models.

Source

Thrown at official/projects/videoglue/tools/checkpoint_loader.py:107

    if tf.io.gfile.isdir(ckpt_dir_or_file):
      ckpt_dir_or_file = tf.train.latest_checkpoint(ckpt_dir_or_file)

    self._load_checkpoint(model, ckpt_dir_or_file)
    logging.info('Finished loading pretrained checkpoint from %s',
                 ckpt_dir_or_file)

  def _load_checkpoint(self, model: tf_keras.Model, ckpt_dir_or_file: str):
    """Loads checkpoint."""
    if self._init_checkpoint_type == 'all':
      ckpt = tf.train.Checkpoint(model=model)
      status = ckpt.read(ckpt_dir_or_file)
      status.expect_partial().assert_existing_objects_matched()
    elif self._init_checkpoint_type == 'backbone':
      ckpt = tf.train.Checkpoint(backbone=model.backbone)
      status = ckpt.read(ckpt_dir_or_file)
      status.expect_partial().assert_existing_objects_matched()
    else:
      raise ValueError(
          'Unrecognized init_checkpoint_type: %s' % self._init_checkpoint_type)

  def _remap_variable_name(self,
                           variable_name: str,
                           name_mapping: List[Tuple[str, str]]):
    """Remaps variable name given the mapping."""
    for source, dest in name_mapping:
      variable_name = re.sub(source, dest, variable_name)
    return variable_name


class CheckpointLoaderVMAE(CheckpointLoaderBase):
  """Checkpoint loader for Video MAE."""

  def _maybe_transpose_pytorch_weight(self, ckpt_weight):
    """Transposes pytorch weight to macth with the Tensorflow convention."""
    if len(ckpt_weight.shape) == 2:
      # fc kernel

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/videoglue/tools/checkpoint_loader.py:107 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/ccb5e12888202ad8. Report an issue: GitHub.