1

I have load the inceptionResNetV2 Keras model

base_model = tf.keras.applications.inception_resnet_v2.InceptionResNetV2(include_top=False, weights='imagenet')

I want to find the shapes of the activations outputed by different layers -- assuming a standard input size of (299x299).

My ultimate goal is to make an informed decision on what part of the pre-trained model to retain untrained (using also other criteria).

I tried:

base_model.summary()

Which returns:

enter image description here

Similarly when I try:

enter image description here

In other words I am getting the depth (number of filters) of the activation tensor but not the Width/Height.

What should I do to find the shape of activations once I input a (299x299) image to the network?

halfer
  • 19,824
  • 17
  • 99
  • 186
user8270077
  • 4,621
  • 17
  • 75
  • 140

1 Answers1

1

You can put the input_shape in the function by

base_model = tf.keras.applications.inception_resnet_v2.InceptionResNetV2(include_top=False, weights='imagenet', input_shape=(299, 299, 3))

But this will raise an error if input images aren't 299*299 so better use it only when you want to know the shape.

Natthaphon Hongcharoen
  • 2,244
  • 1
  • 9
  • 23