In [ ]:
from keras.applications import Xception
from keras.layers import Input, Dense

In [ ]:
img_height = 299
img_width = 299

input_tensor = Input(shape=(img_width, img_height, 3))

pre_trained_model = Xception(weights='imagenet', input_tensor=input_tensor, include_top=False, pooling='avg')
# Downloads 83.7Mb of model...,

In [ ]:
pre_trained_model.layers[20].name
# 'block3_sepconv2' ( next are 'block3_sepconv2_bn' and 'conv2d_2' )

In [ ]:
pre_trained_model.summary()
#Total params: 20,861,480
#Trainable params: 20,806,952
#Non-trainable params: 54,528
# Input ... block3_sepconv2 ... block14_sepconv2 ... global_average_pooling2d_1

In [ ]:
### That's a lot of fine tuning...

In [ ]:

Should check the layout of the PyTorch model too...

https://github.com/Cadene/pretrained-models.pytorch/blob/master/pretrainedmodels/models/xception.py#L137

Seems to be only 12 blocks, which is a little odd...


In [ ]:


In [ ]: