Hi, I don’t pass the tests but I can’t see where my mistake is:
Test failed
Expected value
[‘Functional’, (None, 5, 5, 1280), 2257984]
does not match the input value:
[‘GlobalAveragePooling2D’, (None, 3), 0]
My code:
# Freeze the base model by making it non trainable
base_model.trainable = False
# create the input layer (Same as the imageNetv2 input size)
inputs = tf.keras.Input(shape=input_shape)
# apply data augmentation to the inputs
x = data_augmentation(inputs)
# data preprocessing using the same weights the model was trained on
x = tf.keras.applications.mobilenet_v2.preprocess_input(x)
# set training to False to avoid keeping track of statistics in the batch norm layer
base_model.training = False
# Add the new Binary classification layers
# use global avg pooling to summarize the info in each channel
x = tfl.GlobalAveragePooling2D()(x)
#include dropout with probability of 0.2 to avoid overfitting
x = tfl.Dropout(rate=0.2)(x)
# create a prediction layer with one neuron (as a classifier only needs one)
prediction_layer = tf.keras.layers.Dense(1, activation='linear')
Can someone see what is wrong ?
Thanks !