tensorflow/models · error · ConfigError

must be a non-empty string.

Error message

{field_name} must be a non-empty string.

What it means

A ConfigError from _require_non_empty_string: the value is either not a string or is a string that is empty/whitespace-only. It fires during load_config validation of text fields such as prompt_to_detect.

Solutions

  1. Provide an actual non-empty value for the field.
  2. Quote the value in YAML to avoid it being parsed as null or another type.
  3. Check for placeholder or blank values left in the config.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:344 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/60411ad4d00a1efb. Report an issue: GitHub.

Appendix: source

Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/config_loader.py:344

    raise ConfigError(f"{field_name} must be at least 1, got {value!r}.")
  return int(value)


def _require_non_empty_string(value: Any, field_name: str) -> str:
  """Validates that a value is a non-empty string.

  Args:
      value: The value to validate.
      field_name: Field name used in the error message.

  Returns:
      The validated string, unchanged.

  Raises:
      ConfigError: If the value is not a non-empty string.
  """
  if not isinstance(value, str) or not value.strip():
    raise ConfigError(f"{field_name} must be a non-empty string.")
  return value


def _require_allowed_folder_name(
    value: Any, field_name: str
) -> str:
  """Validates a folder-name field against its single allowed value.

  Each folder-name knob has exactly one allowed value declared in
  ``_ALLOWED_FOLDER_NAMES``. Any other value is rejected with a message
  listing the allowed set.

  Args:
      value: The value to validate.
      field_name: The top-level YAML field name (also the key into
        ``_ALLOWED_FOLDER_NAMES``).

  Returns:

View on GitHub (pinned to e006f5f0d5)