Last active
August 27, 2019 23:18
-
-
Save GeorgeSeif/8262b86ee7b57dc1207f29f8b4bf4ec2 to your computer and use it in GitHub Desktop.
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
| from keras.applications.nasnet import Xception, preprocess_input | |
| from keras.models import Sequential, Model | |
| from keras.layers.core import Lambda | |
| from keras.backend import tf as ktf | |
| # Initialize a Xception model | |
| Xception_model = Xception(include_top=True, weights='imagenet', input_tensor=None, input_shape=None) | |
| # Any required pre-processing should be baked into the model | |
| input_tensor = Input(shape=(None, None, 3)) | |
| x = Lambda(lambda image: ktf.image.resize_images(image, (299, 299)))(input_tensor) | |
| x = Lambda(lambda image: preprocess_input(image))(x) | |
| output_tensor = Xception_model(x) | |
| final_Xception_model = Model(input_tensor, output_tensor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment