I have the following code
from tensorflow import keras
from keras import backend as K
pool_size = (2,2,2)
strides = (2,2,2)
yt = K.zeros(shape=(10,10,10))
result = keras.backend.pool3d(yt, pool_size, strides, pool_mode="avg")
When I try to run the code it says
.. InvalidArgumentError: tensor_in must be 5-dimensional [Op:AvgPool3D] name: AvgPool3D/
I seem to not like the dimension of yt. But I want to max pool in 3d image whose dimension is 3x3x3. What should the other dimension be?
As every convolution-like operation in Keras, these dimensions are required.
(batch, size1, size2, size3, channels)
(batch, channels, size1, size2, size3)
So:
yt = K.zeros(shape=(1,10,10,10,1))