keras-team/keras · error · ValueError
ConvLSTM layers only support static input shapes for the spa
Error message
ConvLSTM layers only support static input shapes for the spatial dimension. Received invalid input shape: input_shape={inputs_shape} What it means
Error "ConvLSTM layers only support static input shapes for the spatial dimension. Received invalid input shape: input_shape={inputs_shape}" thrown in keras-team/keras.
Source
Thrown at keras/src/layers/rnn/conv_lstm.py:172
self.kernel_constraint = constraints.get(kernel_constraint)
self.recurrent_constraint = constraints.get(recurrent_constraint)
self.bias_constraint = constraints.get(bias_constraint)
self.dropout = min(1.0, max(0.0, dropout))
self.recurrent_dropout = min(1.0, max(0.0, recurrent_dropout))
self.dropout_mask_count = 4
self.input_spec = InputSpec(ndim=rank + 2)
self.state_size = -1 # Custom, defined in methods
def build(self, inputs_shape, states_shape=None):
if self.data_format == "channels_first":
channel_axis = 1
self.spatial_dims = inputs_shape[2:]
else:
channel_axis = -1
self.spatial_dims = inputs_shape[1:-1]
if None in self.spatial_dims:
raise ValueError(
"ConvLSTM layers only support static "
"input shapes for the spatial dimension. "
f"Received invalid input shape: input_shape={inputs_shape}"
)
if inputs_shape[channel_axis] is None:
raise ValueError(
"The channel dimension of the inputs (last axis) should be "
"defined. Found None. Full input shape received: "
f"input_shape={inputs_shape}"
)
self.input_spec = InputSpec(
ndim=self.rank + 3, shape=(None,) + inputs_shape[1:]
)
input_dim = inputs_shape[channel_axis]
self.input_dim = input_dim
self.kernel_shape = self.kernel_size + (input_dim, self.filters * 4)
recurrent_kernel_shape = self.kernel_size + (View on GitHub (pinned to 7a34a03db6)
When it happens
Trigger: Thrown at keras/src/layers/rnn/conv_lstm.py:172 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/10148de7c612e78a.
Report an issue: GitHub.