keras-team/keras · error · AttributeError

Variable is not properly initialized (raw_value missing) and

Error message

Variable is not properly initialized (raw_value missing) and has no initializer.

What it means

Error "Variable is not properly initialized (raw_value missing) and has no initializer." thrown in keras-team/keras.

Source

Thrown at keras/src/backend/jax/core.py:293

        @property
        def value(self):
            if in_stateless_scope():
                scope = get_stateless_scope()
                stateless_value = scope.get_current_value(self)
                if stateless_value is not None:
                    return self._maybe_autocast(stateless_value)
            current_value = _get_raw_value(self)
            if current_value is None:
                # Uninitialized variable (created under a stateless scope,
                # which defers initialization). Return a placeholder, like
                # `KerasVariable.value`, without mutating the variable.
                if self._initializer is not None:
                    return self._maybe_autocast(
                        self._initializer(self._shape, dtype=self._dtype)
                    )
                else:
                    raise AttributeError(
                        "Variable is not properly initialized (raw_value "
                        "missing) and has no initializer."
                    )
            if (
                hasattr(self, "_var_metadata")
                and "on_get_value" in self._var_metadata
            ):
                current_value = self._var_metadata["on_get_value"](
                    self, current_value
                )
            return self._maybe_autocast(current_value)

    Variable = NnxVariable

    def _flatten_nnx_variable(variable):
        children = (_get_raw_value(variable),)
        # We copy __dict__ to avoid side effects
        keras_state = variable.__dict__.copy()

View on GitHub (pinned to 7a34a03db6)

When it happens

Trigger: Thrown at keras/src/backend/jax/core.py:293 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of keras-team/keras@7a34a03db6 (2026-08-25). Data as JSON: /api/errors/2b237bbd63fea734. Report an issue: GitHub.