{"record":{"id":"fc463aa6f5545d9f","repo":"tensorflow/models","slug":"the-mode-is-not-supported-by-the-parser","errorCode":null,"errorMessage":"The mode {} is not supported by the Parser.","messagePattern":"The mode (.+?) is not supported by the Parser\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/simclr/dataloaders/simclr_input.py","lineNumber":194,"sourceCode":"    return image\n\n  def _parse_train_data(self, decoded_tensors):\n    \"\"\"Parses data for training.\"\"\"\n    image_bytes = decoded_tensors['image/encoded']\n\n    if self._mode == simclr_model.FINETUNE:\n      image = self._parse_one_train_image(image_bytes)\n\n    elif self._mode == simclr_model.PRETRAIN:\n      # Transform each example twice using a combination of\n      # simple augmentations, resulting in 2N data points\n      xs = []\n      for _ in range(2):\n        xs.append(self._parse_one_train_image(image_bytes))\n      image = tf.concat(xs, -1)\n\n    else:\n      raise ValueError('The mode {} is not supported by the Parser.'\n                       .format(self._mode))\n\n    if self._parse_label:\n      label = tf.cast(decoded_tensors['image/class/label'], dtype=tf.int32)\n      return image, label\n\n    return image\n\n  def _parse_eval_data(self, decoded_tensors):\n    \"\"\"Parses data for evaluation.\"\"\"\n    image_bytes = decoded_tensors['image/encoded']\n    image_shape = tf.image.extract_jpeg_shape(image_bytes)\n\n    if self._test_crop:\n      image = preprocess_ops.center_crop_image_v2(image_bytes, image_shape)\n    else:\n      image = tf.image.decode_jpeg(image_bytes, channels=3)\n    # This line convert the image to float 0.0 - 1.0","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/simclr/dataloaders/simclr_input.py#L176-L212","documentation":"Error \"The mode {} is not supported by the Parser.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/simclr/dataloaders/simclr_input.py:194 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"}