{"record":{"id":"71e4f9c364fa3a8f","repo":"keras-team/keras","slug":"the-endpoint-call-training-endpoint-is-neither","errorCode":null,"errorMessage":"The endpoint '{call_training_endpoint}' is neither an attribute of the reloaded SavedModel, nor an entry in the `signatures` field of the reloaded SavedModel. Available endpoints for this SavedModel: {list(self._reloaded_obj.signatures.keys())}","messagePattern":"The endpoint '(.+?)' is neither an attribute of the reloaded SavedModel, nor an entry in the `signatures` field of the reloaded SavedModel\\. Available endpoints for this SavedModel: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/export/tfsm_layer.py","lineNumber":102,"sourceCode":"                \"nor an entry in the `signatures` field of \"\n                \"the reloaded SavedModel. Select another endpoint via \"\n                \"the `call_endpoint` argument. Available endpoints for \"\n                \"this SavedModel: \"\n                f\"{list(self._reloaded_obj.signatures.keys())}\"\n            )\n\n        # Resolving the training function.\n        if call_training_endpoint:\n            if hasattr(self._reloaded_obj, call_training_endpoint):\n                self.call_training_endpoint_fn = getattr(\n                    self._reloaded_obj, call_training_endpoint\n                )\n            elif call_training_endpoint in self._reloaded_obj.signatures:\n                self.call_training_endpoint_fn = self._reloaded_obj.signatures[\n                    call_training_endpoint\n                ]\n            else:\n                raise ValueError(\n                    f\"The endpoint '{call_training_endpoint}' \"\n                    \"is neither an attribute of the reloaded SavedModel, \"\n                    \"nor an entry in the `signatures` field of \"\n                    \"the reloaded SavedModel. Available endpoints for \"\n                    \"this SavedModel: \"\n                    f\"{list(self._reloaded_obj.signatures.keys())}\"\n                )\n\n        # Add trainable and non-trainable weights from the call_endpoint_fn.\n        all_fns = [self.call_endpoint_fn]\n        if call_training_endpoint:\n            all_fns.append(self.call_training_endpoint_fn)\n        tvs, ntvs = _list_variables_used_by_fns(all_fns)\n        for v in tvs:\n            self._add_existing_weight(v)\n        for v in ntvs:\n            self._add_existing_weight(v)\n","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/export/tfsm_layer.py#L84-L120","documentation":"Same resolution logic as call_endpoint, but for call_training_endpoint: TFSMLayer looks the name up first as an attribute of the reloaded SavedModel, then in its signatures field, and raises ValueError when absent. Training endpoints only exist if they were explicitly exported (e.g. ExportArchive.add_endpoint for a train function, or a 'train' signature passed to tf.saved_model.save). Requesting one that was never exported triggers this error.","triggerScenarios":"TFSMLayer(path, call_endpoint='serving_default', call_training_endpoint='train') on a model exported without a train endpoint; misspelled training signature names; SavedModels from TF-Hub which typically export only serving signatures.","commonSituations":"Needing train vs inference behavior on a reloaded model; forgetting that the export archive must include the training endpoint via add_endpoint before the SavedModel contains it.","solutions":["Drop call_training_endpoint (it is optional) if you only need inference.","Re-export the archive including the training endpoint, e.g. archive.add_endpoint(train_fn, name='train'), then pass that exact name.","List available names first: tf.saved_model.load(path).signatures.keys()."],"exampleFix":"# before\nlayer = TFSMLayer('sm/', call_endpoint='serve', call_training_endpoint='training')  # -> ValueError\n\n# after (inference only)\nlayer = TFSMLayer('sm/', call_endpoint='serve')\n# or re-export with archive.add_endpoint(train_fn, name='train') and use call_training_endpoint='train'","handlingStrategy":"validation","validationCode":"import tensorflow as tf\nsigs = list(tf.saved_model.load(path).signatures.keys())\nif call_training_endpoint and call_training_endpoint not in sigs:\n    call_training_endpoint = None  # or raise your own clear error","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pass call_training_endpoint when you actually exported one.","Keep export signature names in a config shared by producer and consumer.","Omit the optional argument instead of guessing names."],"tags":["keras","tfsmlayer","training-endpoint","savedmodel","validation"],"backgroundTag":"invalid-endpoint-name","analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}