tensorflow/models · error · ValueError

checkpoint path is empty

Error message

checkpoint path is empty

What it means

Error "checkpoint path is empty" thrown in tensorflow/models.

Source

Thrown at official/legacy/detection/executor/distributed_executor.py:684

    tf_keras.backend.set_learning_phase(0)
    params = self._params
    strategy = self._strategy
    # To reduce unnecessary send/receive input pipeline operation, we place
    # input pipeline ops in worker task.
    with strategy.scope():

      # To correctly place the model weights on accelerators,
      # model and optimizer should be created in scope.
      model = self.model_fn(params.as_dict())
      checkpoint = tf.train.Checkpoint(model=model)

      eval_metric = eval_metric_fn()
      assert eval_metric, 'eval_metric does not exist'
      test_step = self._create_test_step(strategy, model, metric=eval_metric)

      logging.info('Starting to evaluate.')
      if not checkpoint_path:
        raise ValueError('checkpoint path is empty')
      reader = tf.compat.v1.train.NewCheckpointReader(checkpoint_path)
      if reader.has_tensor('optimizer/iter/.ATTRIBUTES/VARIABLE_VALUE'):
        # Legacy keras optimizer iteration.
        current_step = reader.get_tensor(
            'optimizer/iter/.ATTRIBUTES/VARIABLE_VALUE')
      else:
        # New keras optimizer iteration.
        current_step = reader.get_tensor(
            'optimizer/_iterations/.ATTRIBUTES/VARIABLE_VALUE')
      logging.info('Checkpoint file %s found and restoring from '
                   'checkpoint', checkpoint_path)
      status = checkpoint.restore(checkpoint_path)
      status.expect_partial().assert_existing_objects_matched()

      self.global_train_step = model.optimizer.iterations
      eval_iterator = self._get_input_iterator(eval_input_fn, strategy)
      eval_metric_result = self._run_evaluation(test_step, current_step,
                                                eval_metric, eval_iterator)

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/legacy/detection/executor/distributed_executor.py:684 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/c4389978c4ff846c. Report an issue: GitHub.