{"record":{"id":"585babe3050b3842","repo":"tensorflow/models","slug":"invalid-dtype-provided-supported-types","errorCode":null,"errorMessage":"Invalid DType provided. Supported types: {}","messagePattern":"Invalid DType provided\\. Supported types: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/image_classification/dataset_factory.py","lineNumber":230,"sourceCode":"\n    Returns:\n      A mapping from string representation of a dtype to the `tf.dtypes.DType`.\n\n    Raises:\n      ValueError if the config's dtype is not supported.\n\n    \"\"\"\n    dtype_map = {\n        'float32': tf.float32,\n        'bfloat16': tf.bfloat16,\n        'float16': tf.float16,\n        'fp32': tf.float32,\n        'bf16': tf.bfloat16,\n    }\n    try:\n      return dtype_map[self.config.dtype]\n    except:\n      raise ValueError('Invalid DType provided. Supported types: {}'.format(\n          dtype_map.keys()))\n\n  @property\n  def image_size(self) -> int:\n    \"\"\"The size of each image (can be inferred from the dataset).\"\"\"\n\n    if self.config.image_size == 'infer':\n      return self.info.features['image'].shape[0]\n    else:\n      return int(self.config.image_size)\n\n  @property\n  def num_channels(self) -> int:\n    \"\"\"The number of image channels (can be inferred from the dataset).\"\"\"\n    if self.config.num_channels == 'infer':\n      return self.info.features['image'].shape[-1]\n    else:\n      return int(self.config.num_channels)","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/image_classification/dataset_factory.py#L212-L248","documentation":"Error \"Invalid DType provided. Supported types: {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/image_classification/dataset_factory.py:230 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"}