tensorflow/models · error · ValueError
Both `init_checkpoint` and `model_config_file` should be spe
Error message
Both `init_checkpoint` and `model_config_file` should be specified if `config_file` is not specified.
What it means
Error "Both `init_checkpoint` and `model_config_file` should be specified if `config_file` is not specified." thrown in tensorflow/models.
Source
Thrown at official/nlp/finetuning/glue/flags.py:148
if flags_obj.mode == 'predict':
# model_dir is only needed strictly in 'predict' mode.
_validate_path(flags_obj.model_dir, 'model_dir')
if 'predict' in flags_obj.mode:
_validate_path(flags_obj.test_input_path, 'test_input_path')
if not flags_obj.config_file and flags_obj.mode != 'predict':
if flags_obj.hub_module_url:
if flags_obj.init_checkpoint or flags_obj.model_config_file:
raise ValueError(
'When `hub_module_url` is specified, `init_checkpoint` and '
'`model_config_file` should be empty.')
logging.info(
'Using the pretrained tf.hub from %s', flags_obj.hub_module_url)
else:
if not (flags_obj.init_checkpoint and flags_obj.model_config_file):
raise ValueError('Both `init_checkpoint` and `model_config_file` '
'should be specified if `config_file` is not '
'specified.')
_validate_path(flags_obj.model_config_file, 'model_config_file')
logging.info(
'Using the pretrained checkpoint from %s and model_config_file from '
'%s.', flags_obj.init_checkpoint, flags_obj.model_config_file)
View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/nlp/finetuning/glue/flags.py:148 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/6b61b6baa21b55cf.
Report an issue: GitHub.