I load the model in this way:
model = EfficientNetB7(weights='imagenet', include_top=False, input_shape=input_shape)
What i am trying to do is remove the layer in position:
model.layers[1] #Rescaling
model.layers[2] #Normalization
What i tried is:
del_res= Dense(1, activation='relu', name='remove_rescaling')(base_model.layers[1].output)
del_nor= Dense(1, activation='relu', name='remove_normalization')(base_model.layers[2].output)
but the point is that both layers are still there.
I even tried:
model.layer.pop(1)
model.layer.pop(2)
But nothing to do!!
Do you have any recommendation?