I'm trying get flatten layer as input to convd2d and predicting the output for 10 class classification problem on Densenet with cifar-10 dataset. following code snippet where I'm getting the error.
global compression
BatchNorm = layers.BatchNormalization()(input)
relu = layers.Activation('relu')(BatchNorm)
AvgPooling = layers.AveragePooling2D(pool_size=(2,2))(relu)
flat = layers.Flatten()(AvgPooling)
# output = layers.Dense(num_classes, activation='softmax')(flat)
output = layers.Conv2D(filters=10,kernel_size=3,strides=1,activation='softmax',padding='valid')(flat)
I'm getting the following error
ValueError: Input 0 is incompatible with layer conv2d_513: expected ndim=4, found ndim=2
Can anyone tell me how to resolve it. Thanks in advance.