tensorflow/models · error · ConfigError

must be at least 1, got .

Error message

{field_name} must be at least 1, got {value!r}.

What it means

A ConfigError from _require_positive_int: the value is an integer but less than 1 (zero and negatives rejected). It fires during load_config validation of settings that must be at least 1, such as max_cpu_workers or queue_maxsize.

Solutions

  1. Set the value to at least 1.
  2. Use a sensible positive count, e.g. max_cpu_workers: 8.
  3. Check that an empty or 0 value wasn't left as a placeholder.
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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


def _require_positive_int(value: Any, field_name: str) -> int:
  """Validates that a value is a positive (non-zero) integer.

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

  Returns:
      The validated integer.

  Raises:
      ConfigError: If the value is not a positive integer.
  """
  if isinstance(value, bool) or not isinstance(value, int):
    raise ConfigError(f"{field_name} must be an integer, got {value!r}.")
  if value < 1:
    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.")

View on GitHub (pinned to e006f5f0d5)