Keras: reshape to connect lstm and conv

后端 未结 1 1767
滥情空心
滥情空心 2020-12-30 12:04

This question exists as a github issue , too. I would like to build a neural network in Keras which contains both 2D convolutions and an LSTM layer.

The network shou

1条回答
  •  一整个雨季
    2020-12-30 12:29

    According to Convolution2D definition your input must be 4-dimensional with dimensions (samples, channels, rows, cols). This is the direct reason why are you getting an error.

    To resolve that you must use TimeDistributed wrapper. This allows you to use static (not recurrent) layers across the time.

    0 讨论(0)
提交回复
热议问题