tensorflow/models · error · Exception

Please run accumulate() first

Error message

Please run accumulate() first

What it means

State guard in the COCO wrapper's summarize: the metric accumulation step (which computes the cocoEval.stats array) has not been run — self.stats is empty — so there is nothing to print. It means summarize() was called before accumulate() completed on the Evaluator.

Solutions

  1. Call evaluator.evaluate() (which runs loadRes/ accumulate/ summarize in order) instead of summarize alone
  2. Ensure accumulate() ran successfully before calling summarize()
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at official/legacy/detection/evaluation/coco_evaluator.py:147 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/8db7586c8529ff8a. Report an issue: GitHub.

Appendix: source

Thrown at official/legacy/detection/evaluation/coco_evaluator.py:147

      )
      stats[5] = _summarize(
          1,
          area_rng='large',
      )

      stats[6] = _summarize(0, max_dets=self.params.maxDets[0])  # 10
      stats[7] = _summarize(0, max_dets=self.params.maxDets[1])  # 20
      stats[8] = _summarize(0, max_dets=self.params.maxDets[2])  # 50
      stats[9] = _summarize(0, max_dets=self.params.maxDets[3])  # 100
      stats[10] = _summarize(0, max_dets=self.params.maxDets[4])  # 200

      stats[11] = _summarize(0, area_rng='small', max_dets=10)
      stats[12] = _summarize(0, area_rng='medium', max_dets=10)
      stats[13] = _summarize(0, area_rng='large', max_dets=10)
      return stats

    if not self.eval:
      raise Exception('Please run accumulate() first')
    summarize = _summarize_dets
    self.stats = summarize()


class OlnCOCOevalXclassWrapper(OlnCOCOevalWrapper):
  """COCOeval wrapper class.

  Rewritten based on cocoapi: (pycocotools/cocoeval.py)
  Delta to the standard cocoapi:
    Detections that hit the 'seen' class objects are ignored in top-K proposals.

  This class wraps COCOEVAL API object, which provides the following additional
  functionalities:
    1. Include ignore-class split (e.g., 'voc' or 'nonvoc').
    2. Do not count (or ignore) box proposals hitting ignore-class when
       evaluating Average Recall at top-K proposals.
  """

View on GitHub (pinned to e006f5f0d5)