I am fine-tuning a MobileNet with 14 new classes. When I add new layers by:
x=mobile.layers[-6].output
x=Flatten(x)
predictions = Dense(14, activation=\'soft
The tensor must be passed to the layer when you are calling it, and not as an argument. Therefore it must be like this:
x = Flatten()(x) # first the layer is constructed and then it is called on x
To make it more clear, it is equivalent to this:
flatten_layer = Flatten() # instantiate the layer
x = flatten_layer(x) # call it on the given tensor