Last active
June 21, 2018 22:39
-
-
Save ozgurshn/6ce21878041a23ca6ed4833c98de33a9 to your computer and use it in GitHub Desktop.
Resnet50 model fine-tuned
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_model(): | |
input_tensor = Input(shape=(224, 224, 3)) # this assumes K.image_data_format() == 'channels_last' | |
# create the base pre-trained model | |
base_model = ResNet50(input_tensor=input_tensor,weights='imagenet',include_top=False) | |
for layer in base_model.layers: | |
layer.trainable=False | |
x = base_model.output | |
x = GlobalAveragePooling2D(data_format='channels_last')(x) | |
x = Dense(num_classes, activation='softmax')(x) | |
updatedModel = Model(base_model.input, x) | |
return updatedModel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment