{"record":{"id":"e94173820acca752","repo":"keras-team/keras","slug":"shapes-used-to-initialize-variables-must-be-fully","errorCode":null,"errorMessage":"Shapes used to initialize variables must be fully-defined (no `None` dimensions). Received: shape={shape} for variable path='{self.path}'","messagePattern":"Shapes used to initialize variables must be fully-defined \\(no `None` dimensions\\)\\. Received: shape=(.+?) for variable path='(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/variables.py","lineNumber":238,"sourceCode":"            # returns early and does not raise an error.\n            if config.is_nnx_enabled():\n                return\n            raise ValueError(f\"Variable {self.path} is already initialized.\")\n\n        if in_stateless_scope():\n            raise ValueError(\n                \"You are attempting to initialize a variable \"\n                \"while in a stateless scope. This is disallowed. \"\n                \"Make sure that all variables are initialized \"\n                \"before you start using your layer/model objects.\"\n            )\n        self._initialize_with_initializer(self._initializer)\n        self._initializer = None\n\n    def _validate_shape(self, shape):\n        shape = standardize_shape(shape)\n        if None in shape:\n            raise ValueError(\n                \"Shapes used to initialize variables must be \"\n                \"fully-defined (no `None` dimensions). Received: \"\n                f\"shape={shape} for variable path='{self.path}'\"\n            )\n        return shape\n\n    def _maybe_autocast(self, value):\n        autocast_scope = get_autocast_scope()\n        if self._autocast and autocast_scope is not None:\n            return autocast_scope.maybe_cast(value)\n        return value\n\n    def numpy(self):\n        return np.array(self)\n\n    @property\n    def aggregation(self):\n        \"\"\"The strategy for aggregating this variable.\"\"\"","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/variables.py#L220-L256","documentation":"Error \"Shapes used to initialize variables must be fully-defined (no `None` dimensions). Received: shape={shape} for variable path='{self.path}'\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/common/variables.py:238 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"}