tensorflow/models · error · ValueError

Unknown builder type

Error message

Unknown builder type {}

What it means

Dispatch guard in DatasetBuilder._build: config.builder matched none of 'tfds', 'records', 'synthetic'. The dataset builder type string in the experiment config is unrecognized.

Solutions

  1. Set builder to 'tfds', 'records', or 'synthetic' in the dataset config
  2. Fix typos in the builder type flag
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at official/legacy/image_classification/dataset_factory.py:326 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/2c09c3ed2f4d32b4. Report an issue: GitHub.

Appendix: source

Thrown at official/legacy/image_classification/dataset_factory.py:326

    """Construct a dataset end-to-end and return it.

    Args:
      input_context: An optional context provided by `tf.distribute` for
        cross-replica training.

    Returns:
      A TensorFlow dataset outputting batched images and labels.
    """
    builders = {
        'tfds': self.load_tfds,
        'records': self.load_records,
        'synthetic': self.load_synthetic,
    }

    builder = builders.get(self.config.builder, None)

    if builder is None:
      raise ValueError('Unknown builder type {}'.format(self.config.builder))

    self.input_context = input_context
    dataset = builder()
    dataset = self.pipeline(dataset)

    return dataset

  def load_tfds(self) -> tf.data.Dataset:
    """Return a dataset loading files from TFDS."""

    logging.info('Using TFDS to load data.')
    builder = tfds.builder(self.config.name, data_dir=self.config.data_dir)

    if self.config.download:
      builder.download_and_prepare()

    decoders = {}

View on GitHub (pinned to e006f5f0d5)