text_plain_output_2.png application_vnd.jupyter.stderr_output_1.png
from keras.applications.vgg19 import VGG19

from keras.layers import GlobalAveragePooling2D, Dropout, Dense, Conv2D

from keras.layers import MaxPooling2D, Flatten, Dense

from keras.models import Model, Sequential

from keras.applications.vgg19 import VGG19
from keras.preprocessing import image
from keras.preprocessing.image import img_to_array
from keras.applications.vgg19 import preprocess_input
from keras.models import Model, Sequential
from keras.layers import GlobalAveragePooling2D, Dropout, Dense, Conv2D
from keras.layers import MaxPooling2D, Flatten, Dense
vgg19 = VGG19(weights='../input/vgg19/vgg19_weights_tf_dim_ordering_tf_kernels_notop.h5', include_top=False, input_shape=(224, 224, 3))
for l in vgg19.layers:
    if l is not None:
        l.trainable = False
x = vgg19.output
x = Conv2D(filters=128, kernel_size=(3, 3), activation='relu')(x)
x = MaxPooling2D(pool_size=(2, 2))(x)
x = Flatten()(x)
x = Dense(256, activation='relu')(x)
predictions = Dense(5, activation='softmax')(x)
model = Model(inputs=vgg19.input, outputs=predictions)
model.summary()
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])