commaai/openpilot · error · ValueError

Missing output {name}

Error message

Missing output {name}

What it means

Parser.check_missing raises ValueError when a requested model output tensor name is absent from the outs dict, unless the Parser was constructed with ignore_missing=True. It guards against parsing a model whose output signature does not match what the parser expects.

Source

Thrown at openpilot/selfdrive/modeld/parse_model_outputs.py:27

  return 1. / (1. + safe_exp(-x))

def softmax(x, axis=-1):
  x -= np.max(x, axis=axis, keepdims=True)
  if x.dtype == np.float32 or x.dtype == np.float64:
    safe_exp(x, out=x)
  else:
    x = safe_exp(x)
  x /= np.sum(x, axis=axis, keepdims=True)
  return x

class Parser:
  def __init__(self, ignore_missing=False):
    self.ignore_missing = ignore_missing

  def check_missing(self, outs, name):
    missing = name not in outs
    if missing and not self.ignore_missing:
      raise ValueError(f"Missing output {name}")
    return missing

  def parse_categorical_crossentropy(self, name, outs, out_shape=None):
    if self.check_missing(outs, name):
      return
    raw = outs[name]
    if out_shape is not None:
      raw = raw.reshape((raw.shape[0],) + out_shape)
    outs[name] = softmax(raw, axis=-1)

  def parse_binary_crossentropy(self, name, outs):
    if self.check_missing(outs, name):
      return
    raw = outs[name]
    outs[name] = sigmoid(raw)

  def parse_mdn(self, name, outs, in_N=0, out_N=1, out_shape=()):
    if self.check_missing(outs, name):

View on GitHub (pinned to 516ec1e682)

Solutions

  1. Redownload/refresh the model bundle so outputs match the parser version
  2. Print available output names (list(outs.keys())) and reconcile with the names the parser requests
  3. If the output is genuinely optional for your use, construct Parser(ignore_missing=True) so missing outputs return None instead of raising

Example fix

// before
parser = Parser()
parser.parse_categorical_crossentropy('desire', outs)

// after
parser = Parser(ignore_missing=True)
parser.parse_categorical_crossentropy('desire', outs)
Defensive patterns

Strategy: validation

Validate before calling

required = ['desire', 'meta', 'pose']
missing = [n for n in required if n not in outs]
if missing and not parser.ignore_missing:
    raise ValueError(f'model outputs missing: {missing}')

Prevention

When it happens

Trigger: Running parse_categorical_crossentropy/parse_binary_crossentropy-style parsing (parse_model_outputs) on a model bundle whose ONNX/TFLite outputs were renamed or pruned, or mixing an old downloaded model with new parser code (or vice versa).

Common situations: Stale model weights in /data/models after an openpilot update changed output names, a custom-trained model with different head names, or an experiment model missing a head.

Related errors


AI-assisted analysis of commaai/openpilot@516ec1e682 (2026-08-15). Data as JSON: /api/errors/fc84ba66a07eb8c8. Report an issue: GitHub.