I run your code in my computer, which tf version is 2.4.0. And the head_model has a extra cov layer, thah cause the output to (9,9,64). and would you tell me how can i solve the problem.
the two model's layer show below:
Model: "head_model"
Layer (type) Output Shape Param # Connected to
input (InputLayer) [(None, 28, 28, 1)] 0
augmentation (Sequential) (None, 28, 28, 1) 0 input[0][0]
conv_1 (Conv2D) (None, 28, 28, 16) 160 augmentation[0][0]
bn_1 (BatchNormalization) (None, 28, 28, 16) 64 conv_1[0][0]
relu_1 (Activation) (None, 28, 28, 16) 0 bn_1[0][0]
drop_1 (Dropout) (None, 28, 28, 16) 0 relu_1[0][0]
conv_2 (Conv2D) (None, 28, 28, 32) 4640 drop_1[0][0]
bn_2 (BatchNormalization) (None, 28, 28, 32) 128 conv_2[0][0]
relu_2 (Activation) (None, 28, 28, 32) 0 bn_2[0][0]
drop_2 (Dropout) (None, 28, 28, 32) 0 relu_2[0][0]
maxp_2 (MaxPooling2D) (None, 9, 9, 32) 0 drop_2[0][0]
conv_3 (Conv2D) (None, 9, 9, 32) 9248 maxp_2[0][0]
bn_3 (BatchNormalization) (None, 9, 9, 32) 128 conv_3[0][0]
relu6_3 (Activation) (None, 9, 9, 32) 0 bn_3[0][0]
drop_3 (Dropout) (None, 9, 9, 32) 0 relu6_3[0][0]
conv_4 (Conv2D) (None, 9, 9, 32) 9248 drop_3[0][0]
bn_4 (BatchNormalization) (None, 9, 9, 32) 128 conv_4[0][0]
relu6_4 (Activation) (None, 9, 9, 32) 0 bn_4[0][0]
drop_4 (Dropout) (None, 9, 9, 32) 0 relu6_4[0][0]
add_1 (Add) (None, 9, 9, 32) 0 drop_4[0][0]
maxp_2[0][0]
conv_5 (Conv2D) (None, 9, 9, 32) 9248 add_1[0][0]
bn_5 (BatchNormalization) (None, 9, 9, 32) 128 conv_5[0][0]
relu6_5 (Activation) (None, 9, 9, 32) 0 bn_5[0][0]
drop_5 (Dropout) (None, 9, 9, 32) 0 relu6_5[0][0]
conv_6 (Conv2D) (None, 9, 9, 32) 9248 drop_5[0][0]
bn_6 (BatchNormalization) (None, 9, 9, 32) 128 conv_6[0][0]
relu6_6 (Activation) (None, 9, 9, 32) 0 bn_6[0][0]
drop_6 (Dropout) (None, 9, 9, 32) 0 relu6_6[0][0]
split (Add) (None, 9, 9, 32) 0 drop_6[0][0]
add_1[0][0]
conv_7 (Conv2D) (None, 9, 9, 64) 18496 split[0][0]
Total params: 60,992
Trainable params: 60,640
Non-trainable params: 352
Model: "tail_model"
Layer (type) Output Shape Param #
input_1 (InputLayer) [(None, 9, 9, 32)] 0
conv_7 (Conv2D) (None, 9, 9, 64) 18496
bn_7 (BatchNormalization) (None, 9, 9, 64) 256
relu6_7 (Activation) (None, 9, 9, 64) 0
drop_7 (Dropout) (None, 9, 9, 64) 0
Flatten (Flatten) (None, 5184) 0
dense_1 (Dense) (None, 128) 663680
last_drop (Dropout) (None, 128) 0
output (Dense) (None, 10) 1290
I run your code in my computer, which tf version is 2.4.0. And the head_model has a extra cov layer, thah cause the output to (9,9,64). and would you tell me how can i solve the problem.
the two model's layer show below:
Model: "head_model"
Layer (type) Output Shape Param # Connected to
input (InputLayer) [(None, 28, 28, 1)] 0
augmentation (Sequential) (None, 28, 28, 1) 0 input[0][0]
conv_1 (Conv2D) (None, 28, 28, 16) 160 augmentation[0][0]
bn_1 (BatchNormalization) (None, 28, 28, 16) 64 conv_1[0][0]
relu_1 (Activation) (None, 28, 28, 16) 0 bn_1[0][0]
drop_1 (Dropout) (None, 28, 28, 16) 0 relu_1[0][0]
conv_2 (Conv2D) (None, 28, 28, 32) 4640 drop_1[0][0]
bn_2 (BatchNormalization) (None, 28, 28, 32) 128 conv_2[0][0]
relu_2 (Activation) (None, 28, 28, 32) 0 bn_2[0][0]
drop_2 (Dropout) (None, 28, 28, 32) 0 relu_2[0][0]
maxp_2 (MaxPooling2D) (None, 9, 9, 32) 0 drop_2[0][0]
conv_3 (Conv2D) (None, 9, 9, 32) 9248 maxp_2[0][0]
bn_3 (BatchNormalization) (None, 9, 9, 32) 128 conv_3[0][0]
relu6_3 (Activation) (None, 9, 9, 32) 0 bn_3[0][0]
drop_3 (Dropout) (None, 9, 9, 32) 0 relu6_3[0][0]
conv_4 (Conv2D) (None, 9, 9, 32) 9248 drop_3[0][0]
bn_4 (BatchNormalization) (None, 9, 9, 32) 128 conv_4[0][0]
relu6_4 (Activation) (None, 9, 9, 32) 0 bn_4[0][0]
drop_4 (Dropout) (None, 9, 9, 32) 0 relu6_4[0][0]
add_1 (Add) (None, 9, 9, 32) 0 drop_4[0][0]
maxp_2[0][0]
conv_5 (Conv2D) (None, 9, 9, 32) 9248 add_1[0][0]
bn_5 (BatchNormalization) (None, 9, 9, 32) 128 conv_5[0][0]
relu6_5 (Activation) (None, 9, 9, 32) 0 bn_5[0][0]
drop_5 (Dropout) (None, 9, 9, 32) 0 relu6_5[0][0]
conv_6 (Conv2D) (None, 9, 9, 32) 9248 drop_5[0][0]
bn_6 (BatchNormalization) (None, 9, 9, 32) 128 conv_6[0][0]
relu6_6 (Activation) (None, 9, 9, 32) 0 bn_6[0][0]
drop_6 (Dropout) (None, 9, 9, 32) 0 relu6_6[0][0]
split (Add) (None, 9, 9, 32) 0 drop_6[0][0]
add_1[0][0]
conv_7 (Conv2D) (None, 9, 9, 64) 18496 split[0][0]
Total params: 60,992
Trainable params: 60,640
Non-trainable params: 352
Model: "tail_model"
Layer (type) Output Shape Param #
input_1 (InputLayer) [(None, 9, 9, 32)] 0
conv_7 (Conv2D) (None, 9, 9, 64) 18496
bn_7 (BatchNormalization) (None, 9, 9, 64) 256
relu6_7 (Activation) (None, 9, 9, 64) 0
drop_7 (Dropout) (None, 9, 9, 64) 0
Flatten (Flatten) (None, 5184) 0
dense_1 (Dense) (None, 128) 663680
last_drop (Dropout) (None, 128) 0
output (Dense) (None, 10) 1290