tensorflow/models · error · ValueError
The flag --experiment must be specified.
Error message
The flag --experiment must be specified.
What it means
Error "The flag --experiment must be specified." thrown in tensorflow/models.
Source
Thrown at official/core/train_utils.py:329
separately.
"""
def __init__(self, flags_obj):
self._flags_obj = flags_obj
def parse(self):
"""Overrall process of constructing Experiment config."""
params = self.base_experiment()
params = self.parse_config_file(params)
params = self.parse_runtime(params)
params = self.parse_data_service(params)
params = self.parse_params_override(params)
return params
def base_experiment(self):
"""Get the base experiment config from --experiment field."""
if self._flags_obj.experiment is None:
raise ValueError('The flag --experiment must be specified.')
return exp_factory.get_exp_config(self._flags_obj.experiment)
def parse_config_file(self, params):
"""Override the configs of params from the config_file."""
is_strict = True
if isinstance(self._flags_obj, ParseConfigOptions):
is_strict = self._flags_obj.strict_override
for config_file in self._flags_obj.config_file or []:
params = hyperparams.override_params_dict(
params, config_file, is_strict=is_strict
)
return params
def parse_runtime(self, params):
"""Override the runtime configs of params from flags."""
# Override the TPU address and tf.data service address.
params.override({
'runtime': {View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/core/train_utils.py:329 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/36da5e1c625e64f7.
Report an issue: GitHub.