{"record":{"id":"02f26b579b76483e","repo":"keras-team/keras","slug":"for-nasnet-a-models-the-penultimate-filters-mus","errorCode":null,"errorMessage":"For NASNet-A models, the `penultimate_filters` must be a multiple of 24 * (`filter_multiplier` ** 2). Current value: {penultimate_filters}","messagePattern":"For NASNet-A models, the `penultimate_filters` must be a multiple of 24 \\* \\(`filter_multiplier` \\*\\* 2\\)\\. Current value: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/applications/nasnet.py","lineNumber":181,"sourceCode":"            \"However your settings specify the default \"\n            'data format \"channels_first\" (channels, width, height).'\n            ' You should set `image_data_format=\"channels_last\"` '\n            \"in your Keras config located at ~/.keras/keras.json. \"\n            \"The model being returned right now will expect inputs \"\n            'to follow the \"channels_last\" data format.',\n            stacklevel=2,\n        )\n\n    if input_tensor is None:\n        img_input = layers.Input(shape=input_shape)\n    else:\n        if not backend.is_keras_tensor(input_tensor):\n            img_input = layers.Input(tensor=input_tensor, shape=input_shape)\n        else:\n            img_input = input_tensor\n\n    if penultimate_filters % (24 * (filter_multiplier**2)) != 0:\n        raise ValueError(\n            \"For NASNet-A models, the `penultimate_filters` must be a multiple \"\n            \"of 24 * (`filter_multiplier` ** 2). \"\n            f\"Current value: {penultimate_filters}\"\n        )\n\n    channel_dim = 1 if backend.image_data_format() == \"channels_first\" else -1\n    filters = penultimate_filters // 24\n\n    x = layers.Conv2D(\n        stem_block_filters,\n        (3, 3),\n        strides=(2, 2),\n        padding=\"valid\",\n        use_bias=False,\n        name=\"stem_conv1\",\n        kernel_initializer=\"he_normal\",\n    )(img_input)\n","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/applications/nasnet.py#L163-L199","documentation":"Error \"For NASNet-A models, the `penultimate_filters` must be a multiple of 24 * (`filter_multiplier` ** 2). Current value: {penultimate_filters}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/applications/nasnet.py:181 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"}