text_plain_output_1.png
from keras import layers

from keras.applications import DenseNet121

from keras.models import Sequential

from keras.optimizers import Adam

densenet = DenseNet121(weights='imagenet', include_top=False, input_shape=(224, 224, 3))

def build_model():
    model = Sequential()
    model.add(densenet)
    model.add(layers.GlobalAveragePooling2D())
    model.add(layers.Dropout(0.5))
    model.add(layers.Dense(10, activation='sigmoid'))
    model.compile(loss='binary_crossentropy', optimizer=Adam(lr=5e-05), metrics=['accuracy'])
    return model

model = build_model()
model.summary()