tensorflow/models · error · ValueError

{sample_target_key} is not found in input dictionary.

Error message

{sample_target_key} is not found in input dictionary.

What it means

Error "{sample_target_key} is not found in input dictionary." thrown in tensorflow/models.

Source

Thrown at official/projects/videoglue/datasets/common/processors.py:680

    num_steps: int,
    stride: int,
    sample_target_key: str = 'image',
    keyframe_index_key: str = 'keyframe_index'
) -> MutableMapping[str, tf.Tensor]:
  """Samples a single segment around keyframe from a given sequence.

  Args:
    inputs: dict with sample_target and keyframe_index features.
    num_steps: Number of steps (e.g. frames) to take.
    stride: the stride of sampling.
    sample_target_key: the key for the sample target.
    keyframe_index_key: the key for the keyframe index.

  Returns:
    Modified inputs with sampled target.
  """
  if sample_target_key not in inputs:
    raise ValueError(f'{sample_target_key} is not found in input dictionary.')
  if keyframe_index_key not in inputs:
    raise ValueError(f'{keyframe_index_key} is not found in input dictionary.')

  sequence = inputs[sample_target_key]

  keyframe_index = tf.cast(inputs[keyframe_index_key], dtype=tf.int32)
  keyframe_index = tf.squeeze(keyframe_index)  # assuming there's a single one

  sequence_length = tf.shape(sequence)[0]
  sequence_length = tf.cast(sequence_length, tf.int32)

  early = keyframe_index - (num_steps * stride) // 2
  late = keyframe_index + (num_steps * stride) // 2
  offset = tf.maximum(0, early)

  pad_before = tf.maximum(0, -early)
  pad_after = tf.maximum(0, late - sequence_length)

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/videoglue/datasets/common/processors.py:680 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/b4a552fa26648450. Report an issue: GitHub.