tensorflow/models · error · ConfigError

must be an integer, got .

Error message

{field_name} must be an integer, got {value!r}.

What it means

A ConfigError from _require_positive_int: the YAML value is not an int (booleans rejected explicitly, since bool subclasses int). It fires during load_config validation of integer settings such as max_cpu_workers and queue_maxsize.

Solutions

  1. Write the value as a plain unquoted integer, e.g. 4.
  2. Remove quotes around the value so YAML parses it as an int, not a string.
  3. Replace true/false or float values like 4.0 with an integer.
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

    )
  return float(value)


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.
  """

View on GitHub (pinned to e006f5f0d5)