{"record":{"id":"a634a5a4e20a0fc8","repo":"tensorflow/models","slug":"invalid-label-field-self-label-field","errorCode":null,"errorMessage":"Invalid label field: {self._label_field}!","messagePattern":"Invalid label field: (.+?)!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/yt8m/dataloaders/yt8m_input.py","lineNumber":308,"sourceCode":"        feature_type = tf.io.FixedLenSequenceFeature([], dtype=tf.string)\n      else:\n        dtype = tf.dtypes.as_dtype(self._feature_dtypes[i])\n        feature_shape = [self._feature_sizes[i]]\n        if self._feature_sources[i] == \"feature\":\n          feature_type = tf.io.FixedLenSequenceFeature(feature_shape, dtype)\n        else:\n          feature_type = tf.io.FixedLenFeature(feature_shape, dtype)\n      if self._feature_sources[i] == \"feature\":\n        self._sequence_features[name] = feature_type\n      elif self._feature_sources[i] == \"context\":\n        self._context_features[name] = feature_type\n      else:\n        raise ValueError(\n            f\"Unknown feature source {self._feature_sources[i]} for {name}\")\n\n  def _add_labels_specification(self):\n    if not self._label_field:\n      raise ValueError(f\"Invalid label field: {self._label_field}!\")\n    self._context_features.update(\n        {self._label_field: tf.io.VarLenFeature(tf.int64)})\n\n  def decode(self,\n             serialized_example: tf.train.SequenceExample) -> Dict[str, Any]:\n    \"\"\"Parses a single tf.train.SequenceExample into video and label tensors.\"\"\"\n    contexts, features = tf.io.parse_single_sequence_example(\n        serialized_example,\n        context_features=self._context_features,\n        sequence_features=self._sequence_features)\n    decoded_tensor = {**contexts, **features}\n    for i, name in enumerate(self._feature_names):\n      # Convert the VarLen feature to dense tensor.\n      if self._feature_from_bytes[i]:\n        dtype = tf.dtypes.as_dtype(self._feature_dtypes[i])\n        decoded_tensor[name] = tf.cast(\n            tf.io.decode_raw(decoded_tensor[name], out_type=dtype), tf.float32\n        )","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/yt8m/dataloaders/yt8m_input.py#L290-L326","documentation":"Error \"Invalid label field: {self._label_field}!\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/yt8m/dataloaders/yt8m_input.py:308 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}