I'm new to programming and I need to add Dropout to my model however it's giving me the error "AttributeError: 'Functional' object has no attribute 'add'". I saw in other questions that it could be because the model is functional and not sequential, but I couldn't adapt. Could you help me, please?
from tensorflow.keras.layers import Dropout
#Backbone: ResNet-34; Dropout: 20%; Transfer Learning: ImageNet; Otmizer: Adam; Loss: Dice Loss; Metric: F1 Score, IOU, Accuracy
model = sm.Unet(BACKBONE, encoder_weights='imagenet', encoder_freeze=True)
model.add(Dropout(0.2))
model.compile(optimizer='Adam', loss=dice_loss, metrics=[f1, sm.metrics.iou_score, 'accuracy'])
model.trainable = True
print(model.summary())
Thank you in advance! Best Regards, Allana.
model = Sequential()