{"record":{"id":"6b61b6baa21b55cf","repo":"tensorflow/models","slug":"both-init-checkpoint-and-model-config-file-sho","errorCode":null,"errorMessage":"Both `init_checkpoint` and `model_config_file` should be specified if `config_file` is not specified.","messagePattern":"Both `init_checkpoint` and `model_config_file` should be specified if `config_file` is not specified\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/nlp/finetuning/glue/flags.py","lineNumber":148,"sourceCode":"\n  if flags_obj.mode == 'predict':\n    # model_dir is only needed strictly in 'predict' mode.\n    _validate_path(flags_obj.model_dir, 'model_dir')\n\n  if 'predict' in flags_obj.mode:\n    _validate_path(flags_obj.test_input_path, 'test_input_path')\n\n  if not flags_obj.config_file and flags_obj.mode != 'predict':\n    if flags_obj.hub_module_url:\n      if flags_obj.init_checkpoint or flags_obj.model_config_file:\n        raise ValueError(\n            'When `hub_module_url` is specified, `init_checkpoint` and '\n            '`model_config_file` should be empty.')\n      logging.info(\n          'Using the pretrained tf.hub from %s', flags_obj.hub_module_url)\n    else:\n      if not (flags_obj.init_checkpoint and flags_obj.model_config_file):\n        raise ValueError('Both `init_checkpoint` and `model_config_file` '\n                         'should be specified if `config_file` is not '\n                         'specified.')\n      _validate_path(flags_obj.model_config_file, 'model_config_file')\n      logging.info(\n          'Using the pretrained checkpoint from %s and model_config_file from '\n          '%s.', flags_obj.init_checkpoint, flags_obj.model_config_file)\n","sourceCodeStart":130,"sourceCodeEnd":155,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/finetuning/glue/flags.py#L130-L155","documentation":"Error \"Both `init_checkpoint` and `model_config_file` should be specified if `config_file` is not specified.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/finetuning/glue/flags.py:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}