kentsommer / keras-inceptionV4

Keras Implementation of Google's Inception-V4 Architecture (includes Keras compatible pre-trained weights)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extract feature layer

dineshbvadhia opened this issue · comments

Hi! How do you extract the AveragePooling2D layer?

In keras for inceptionV3, it is:
model = Model(inputs=base_model.input, outputs=base_model.get_layer('avg_pool').output)

Use model.summary() to find out the layer name and then feed the corresponding layer name to model.get_layer()

@dineshbvadhia

Abhijit's answer is correct, however, the name is not explicitly given so its the default name for an average pooling layer with a number after indicating which layer it is in the model. I'll close this out now, feel free to re-open if you need more assistance.