{"record":{"id":"f76b13ff813d3e83","repo":"tensorflow/models","slug":"build-loss-fn-must-be-called-after-build-model-f76b13","errorCode":null,"errorMessage":"build_loss_fn() must be called after build_model().","messagePattern":"build_loss_fn\\(\\) must be called after build_model\\(\\)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/detection/modeling/retinanet_model.py:92","lineNumber":92,"sourceCode":"  def build_loss_fn(self):\n    if self._keras_model is None:\n      raise ValueError('build_loss_fn() must be called after build_model().')","sourceCodeStart":null,"sourceCodeEnd":null,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legaacy/detection/modeling/retinanet_model.py#L92","documentation":"Error \"build_loss_fn() must be called after build_model().\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legaacy/detection/modeling/retinanet_model.py:92 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"}