I'm trying to build a ResNet50 CNN for image classification into 5 different classes. I start by importing this model:
ResNet = ResNet50(
include_top= None, weights='imagenet', input_tensor=None, input_shape=([128, 217, 3]),
pooling=None, classes=5)
And then I try to add some final layers for the classification:
ResNet.add(Flatten())
ResNet.add(Dense(units=512, activation='relu'))
ResNet.add(Dropout(0.5))
ResNet.add(Dense(units=256, activation='relu'))
ResNet.add(Dropout(0.5))
ResNet.add(Dense(units=5, activation='softmax'))
But when I try this I get an error that says:
AttributeError: 'Functional' object has no attribute 'add'
Does anybody know how to fix this? Or how should I try to add the layers?