{"record":{"id":"32e28355153e383b","repo":"tensorflow/models","slug":"variables-to-load-is-empty","errorCode":null,"errorMessage":"Variables to load is empty.","messagePattern":"Variables to load is empty\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/detection/modeling/checkpoint_utils.py","lineNumber":139,"sourceCode":"  \"\"\"\n\n  def _restore_checkpoint_fn(keras_model):\n    \"\"\"Loads pretrained model through scaffold function.\"\"\"\n    if not checkpoint_path:\n      logging.info('checkpoint_path is empty')\n      return\n    var_prefix = prefix\n    if prefix and not prefix.endswith('/'):\n      var_prefix += '/'\n    var_to_shape_map = _get_checkpoint_map(checkpoint_path)\n    assert var_to_shape_map, 'var_to_shape_map should not be empty'\n    vars_to_load = _build_assignment_map(\n        keras_model,\n        prefix=var_prefix,\n        skip_variables_regex=skip_regex,\n        var_to_shape_map=var_to_shape_map)\n    if not vars_to_load:\n      raise ValueError('Variables to load is empty.')\n    tf.compat.v1.train.init_from_checkpoint(checkpoint_path, vars_to_load)\n\n  return _restore_checkpoint_fn\n","sourceCodeStart":121,"sourceCodeEnd":143,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/detection/modeling/checkpoint_utils.py#L121-L143","documentation":"Error \"Variables to load is empty.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/detection/modeling/checkpoint_utils.py:139 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"}