{"record":{"id":"316ac21b9935c631","repo":"keras-team/keras","slug":"only-none-and-softmax-activations-are-allowed","errorCode":null,"errorMessage":"Only `None` and `softmax` activations are allowed for the `classifier_activation` argument when using pretrained weights, with `include_top=True`; Received: classifier_activation={classifier_activation}","messagePattern":"Only `None` and `softmax` activations are allowed for the `classifier_activation` argument when using pretrained weights, with `include_top=True`; Received: classifier_activation=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/applications/imagenet_utils.py","lineNumber":460,"sourceCode":"    \"\"\"validates that the classifer_activation is compatible with the weights.\n\n    Args:\n      classifier_activation: str or callable activation function\n      weights: The pretrained weights to load.\n\n    Raises:\n      ValueError: if an activation other than `None` or `softmax` are used with\n        pretrained weights.\n    \"\"\"\n    if weights is None:\n        return\n\n    classifier_activation = activations.get(classifier_activation)\n    if classifier_activation not in {\n        activations.get(\"softmax\"),\n        activations.get(None),\n    }:\n        raise ValueError(\n            \"Only `None` and `softmax` activations are allowed \"\n            \"for the `classifier_activation` argument when using \"\n            \"pretrained weights, with `include_top=True`; Received: \"\n            f\"classifier_activation={classifier_activation}\"\n        )\n","sourceCodeStart":442,"sourceCodeEnd":466,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/applications/imagenet_utils.py#L442-L466","documentation":"Error \"Only `None` and `softmax` activations are allowed for the `classifier_activation` argument when using pretrained weights, with `include_top=True`; Received: classifier_activation={classifier_activation}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/applications/imagenet_utils.py:460 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":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}