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:
Similarly when I try:
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?
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.