{"record":{"id":"c2f1f7e7992d7935","repo":"tensorflow/models","slug":"dtype-r-is-not-supported","errorCode":null,"errorMessage":"dtype {!r} is not supported!","messagePattern":"dtype (.+?) is not supported!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/simclr/dataloaders/simclr_input.py","lineNumber":143,"sourceCode":"    self._aug_rand_hflip = aug_rand_hflip\n    self._aug_color_distort = aug_color_distort\n    self._aug_color_jitter_strength = aug_color_jitter_strength\n    self._aug_color_jitter_impl = aug_color_jitter_impl\n    self._aug_rand_blur = aug_rand_blur\n    self._parse_label = parse_label\n    self._mode = mode\n    self._test_crop = test_crop\n    if max(self._output_size[0], self._output_size[1]) <= 32:\n      self._test_crop = False\n\n    if dtype == 'float32':\n      self._dtype = tf.float32\n    elif dtype == 'float16':\n      self._dtype = tf.float16\n    elif dtype == 'bfloat16':\n      self._dtype = tf.bfloat16\n    else:\n      raise ValueError('dtype {!r} is not supported!'.format(dtype))\n\n  def _parse_one_train_image(self, image_bytes):\n\n    image = tf.image.decode_jpeg(image_bytes, channels=3)\n    # This line convert the image to float 0.0 - 1.0\n    image = tf.image.convert_image_dtype(image, dtype=tf.float32)\n\n    if self._aug_rand_crop:\n      image = simclr_preprocess_ops.random_crop_with_resize(\n          image, self._output_size[0], self._output_size[1])\n\n    if self._aug_rand_hflip:\n      image = tf.image.random_flip_left_right(image)\n\n    if self._aug_color_distort and self._mode == simclr_model.PRETRAIN:\n      image = simclr_preprocess_ops.random_color_jitter(\n          image=image,\n          color_jitter_strength=self._aug_color_jitter_strength,","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/simclr/dataloaders/simclr_input.py#L125-L161","documentation":"Error \"dtype {!r} is not supported!\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/simclr/dataloaders/simclr_input.py:143 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"}