tensorflow/models · error · ValueError

Malformed hyperparameter value while parsing CSV string: %s

Error message

Malformed hyperparameter value while parsing CSV string: %s

What it means

Error "Malformed hyperparameter value while parsing CSV string: %s" thrown in tensorflow/models.

Source

Thrown at official/modeling/hyperparams/params_dict.py:400

  Returns:
    the converted JSON string.

  Raises:
    ValueError: If csv_str is not in a comma separated string or
      if the string is formatted incorrectly.
  """
  if not csv_str:
    return ''

  array_param_map = collections.defaultdict(str)
  max_index_map = collections.defaultdict(str)
  formatted_entries = []
  nested_map = collections.defaultdict(list)
  pos = 0
  while pos < len(csv_str):
    m = _PARAM_RE.match(csv_str, pos)
    if not m:
      raise ValueError('Malformed hyperparameter value while parsing '
                       'CSV string: %s' % csv_str[pos:])
    pos = m.end()
    # Parse the values.
    m_dict = m.groupdict()
    name = m_dict['name']
    v = m_dict['val']
    bracketed_index = m_dict['bracketed_index']
    # If we reach the name of the array.
    if bracketed_index and '.' not in name:
      # Extract the array's index by removing '[' and ']'
      index = int(bracketed_index[1:-1])
      if '.' in v:
        numeric_val = float(v)
      else:
        numeric_val = int(v)
      # Add the value to the array.
      if name not in array_param_map:
        max_index_map[name] = index  # pyrefly: ignore[unsupported-operation]

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/modeling/hyperparams/params_dict.py:400 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/6aa3b27b0ca7aa70. Report an issue: GitHub.