{"record":{"id":"0908b2effbe2fb94","repo":"keras-team/keras","slug":"when-specifying-the-input-shape-of-a-nasnet-and-lo","errorCode":null,"errorMessage":"When specifying the input shape of a NASNet and loading `ImageNet` weights, the input_shape argument must be static (no None entries). Got: `input_shape={input_shape}`.","messagePattern":"When specifying the input shape of a NASNet and loading `ImageNet` weights, the input_shape argument must be static \\(no None entries\\)\\. Got: `input_shape=(.+?)`\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/applications/nasnet.py","lineNumber":139,"sourceCode":"        raise ValueError(\n            \"The `weights` argument should be either \"\n            \"`None` (random initialization), `imagenet` \"\n            \"(pre-training on ImageNet), \"\n            \"or the path to the weights file to be loaded.\"\n        )\n\n    if weights == \"imagenet\" and include_top and classes != 1000:\n        raise ValueError(\n            'If using `weights` as `\"imagenet\"` with `include_top` '\n            \"as true, `classes` should be 1000\"\n        )\n\n    if (\n        isinstance(input_shape, tuple)\n        and None in input_shape\n        and weights == \"imagenet\"\n    ):\n        raise ValueError(\n            \"When specifying the input shape of a NASNet and loading \"\n            \"`ImageNet` weights, the input_shape argument must be static\"\n            f\" (no None entries). Got: `input_shape={input_shape}`.\"\n        )\n\n    if default_size is None:\n        default_size = 331\n\n    # Determine proper input shape and default size.\n    input_shape = imagenet_utils.obtain_input_shape(\n        input_shape,\n        default_size=default_size,\n        min_size=32,\n        data_format=backend.image_data_format(),\n        require_flatten=include_top,\n        weights=weights,\n    )\n","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/applications/nasnet.py#L121-L157","documentation":"Error \"When specifying the input shape of a NASNet and loading `ImageNet` weights, the input_shape argument must be static (no None entries). Got: `input_shape={input_shape}`.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/applications/nasnet.py:139 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"}