tensorflow/models · error · ValueError
Did not pass all values of array
Error message
Did not pass all values of array: %s
What it means
Completeness guard in nested_csv_str_to_json_str: an array/nested parameter was only partially populated — some indices of the array (e.g. a.b[0], a.b[2] given but a.b[1] missing), so the resulting JSON array would contain unfilled slots.
Solutions
- Provide a value for every index of the array parameter in the override string
- Use contiguous indices starting at 0 covering the full array
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at official/modeling/hyperparams/params_dict.py:453 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/7f260c8a30e479d2.
Report an issue: GitHub.
Appendix: source
Thrown at official/modeling/hyperparams/params_dict.py:453
if len(name_nested) > 1:
grouping = name_nested[0]
if bracketed_index:
value = '.'.join(name_nested[1:]) + bracketed_index + '=' + v
else:
value = '.'.join(name_nested[1:]) + '=' + v
nested_map[grouping].append(value)
else:
formatted_entries.append('%s : %s' % (name, v))
for grouping, value in nested_map.items():
value = ','.join(value)
value = nested_csv_str_to_json_str(value)
formatted_entries.append('%s : %s' % (grouping, value))
# Add array parameters and check that the array is fully initialized.
for name in array_param_map:
if any(v is None for v in array_param_map[name]):
raise ValueError('Did not pass all values of array: %s' % name)
formatted_entries.append('%s : %s' % (name, array_param_map[name]))
return '{' + ', '.join(formatted_entries) + '}'
def override_params_dict(params, dict_or_string_or_yaml_file, is_strict):
"""Override a given ParamsDict using a dict, JSON/YAML/CSV string or YAML file.
The logic of the function is outlined below:
1. Test that the input is a dict. If not, proceed to 2.
2. Tests that the input is a string. If not, raise unknown ValueError
2.1. Test if the string is in a CSV format. If so, parse.
If not, proceed to 2.2.
2.2. Try loading the string as a YAML/JSON. If successful, parse to
dict and use it to override. If not, proceed to 2.3.
2.3. Try using the string as a file path and load the YAML file.
Args:View on GitHub (pinned to e006f5f0d5)