tensorflow/models · error · ValueError

Unsupported init_checkpoint_modules: {self._task_config.init

Error message

Unsupported init_checkpoint_modules: {self._task_config.init_checkpoint_modules}

What it means

Error "Unsupported init_checkpoint_modules: {self._task_config.init_checkpoint_modules}" thrown in tensorflow/models.

Source

Thrown at official/projects/pix2seq/tasks/pix2seq_task.py:106

        early_stopping_token=config.early_stopping_token,
    )
    return model

  def _get_ckpt(self, ckpt_dir_or_file: str) -> str:
    if tf.io.gfile.isdir(ckpt_dir_or_file):
      return tf.train.latest_checkpoint(ckpt_dir_or_file)
    return ckpt_dir_or_file

  def initialize(self, model: tf_keras.Model):
    """Loading pretrained checkpoint."""
    if self._task_config.init_checkpoint_modules == 'backbone':
      raise ValueError(
          'init_checkpoint_modules=backbone is no longer supported. Specify'
          ' backbone checkpoints in each backbone config.'
      )

    if self._task_config.init_checkpoint_modules not in ['all', 'partial', '']:
      raise ValueError(
          'Unsupported init_checkpoint_modules: '
          f'{self._task_config.init_checkpoint_modules}'
      )

    if self._task_config.init_checkpoint and any(
        [b.init_checkpoint for b in self._task_config.model.backbones]
    ):
      raise ValueError(
          'A global init_checkpoint and a backbone init_checkpoint cannot be'
          ' specified at the same time.'
      )

    if self._task_config.init_checkpoint:
      global_ckpt_file = self._get_ckpt(self._task_config.init_checkpoint)
      ckpt = tf.train.Checkpoint(**model.checkpoint_items)
      status = ckpt.restore(global_ckpt_file).expect_partial()
      if self._task_config.init_checkpoint_modules != 'partial':
        status.assert_existing_objects_matched()

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/pix2seq/tasks/pix2seq_task.py:106 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/2316116fa25e9f7f. Report an issue: GitHub.