{"record":{"id":"9d317c6ffaa7eb09","repo":"tensorflow/models","slug":"teacher-model-init-checkpoint-is-not-specified","errorCode":null,"errorMessage":"`teacher_model_init_checkpoint` is not specified.","messagePattern":"`teacher_model_init_checkpoint` is not specified\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/edgetpu/nlp/run_mobilebert_edgetpu_train.py","lineNumber":61,"sourceCode":"      distribution_strategy=experiment_params.runtime.distribution_strategy,\n      all_reduce_alg=experiment_params.runtime.all_reduce_alg,\n      num_gpus=experiment_params.runtime.num_gpus,\n      tpu_address=experiment_params.runtime.tpu_address)\n\n  with distribution_strategy.scope():\n    teacher_model = model_builder.build_bert_pretrainer(\n        pretrainer_cfg=experiment_params.teacher_model,\n        quantization_friendly=False,\n        name='teacher')\n    student_model = model_builder.build_bert_pretrainer(\n        pretrainer_cfg=experiment_params.student_model,\n        quantization_friendly=True,\n        name='student')\n\n    # Load model weights.\n    teacher_ckpt_dir_or_file = experiment_params.teacher_model_init_checkpoint\n    if not teacher_ckpt_dir_or_file:\n      raise ValueError('`teacher_model_init_checkpoint` is not specified.')\n    utils.load_checkpoint(teacher_model, teacher_ckpt_dir_or_file)\n\n    student_ckpt_dir_or_file = experiment_params.student_model_init_checkpoint\n    if not student_ckpt_dir_or_file:\n      # Makes sure the pretrainer variables are created.\n      _ = student_model(student_model.inputs)\n      logging.warn('No student checkpoint is provided, training might take '\n                   'much longer before converging.')\n    else:\n      utils.load_checkpoint(student_model, student_ckpt_dir_or_file)\n\n    runner = mobilebert_edgetpu_trainer.MobileBERTEdgeTPUDistillationTrainer(\n        teacher_model=teacher_model,\n        student_model=student_model,\n        strategy=distribution_strategy,\n        experiment_params=experiment_params,\n        export_ckpt_path=model_dir)\n","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/edgetpu/nlp/run_mobilebert_edgetpu_train.py#L43-L79","documentation":"Error \"`teacher_model_init_checkpoint` is not specified.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/edgetpu/nlp/run_mobilebert_edgetpu_train.py:61 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"}