I am utilizing tensorflow ver 2, tensorflow.keras.
A model I made is in a sequence of tf.keras.Conv2D
( which requires 4D input tensor (samples, rows, cols, channels)
then tf.keras.convLSTM2D
(which requires 5D input tensor (samples, time, rows, cols, channels).
Because of this reason, I made an input with 5D tensor (samples, time, rows, cols, channels) but it can't be fed into tf.keras.Conv2D at the beginning when I implement model.fit(train_data, train_data... )
Is there any way to make model.fit to take 5D tensor?
You need to implement TimeDistributed
conv2D as in :
x_conv = tf.keras.layers.TimeDistributed(tf.keras.layers.Conv2D(filters=filters,
kernel_size=kernel_size,
strides=strides,
padding='same',
kernel_initializer='he_normal'))(x)
This way the layers understand that you're giving 4D input over timestep