tensorflow 2.15 backend
inp = layers.Input(batch_shape=batch_shape)
print('Input {}'.format(str(inp.shape)))
Input (1, 7, 60, 60, 1)
x = inp
x = layers.Dropout(0.2)(x)
x = layers.LayerNormalization()(x)
x = layers.Conv2D(filters = 16, kernel_size = (3,3), activation = 'relu', padding = 'same')(x)
print(1, x)
1 KerasTensor(type_spec=TensorSpec(shape=(1, 7, 60, 60, 16), dtype=tf.float32, name=None), name=’conv2d/Relu:0′, description=”created by layer ‘conv2d'”)
x = layers.MaxPooling3D(pool_size = (1, 2, 2))(x),
print(2, x)
2 (<KerasTensor: shape=(1, 7, 30, 30, 16) dtype=float32 (created by layer ‘max_pooling3d’)>,)
why is output 2 a tuple of a tensor instead of simply a tensor? (get tuple result with size 2, 2, 2 as well)
from Keras MaxPooling3D:
Output shape
If data_format=”channels_last”: 5D tensor with shape: (batch_size, pooled_dim1, pooled_dim2, pooled_dim3, channels)