<p>As mentioned in Table 1 in the <a href="https://arxiv.org/pdf/1608.06993.pdf" rel="nofollow noreferrer">DenseNet paper</a>, DenseNet-121 uses something called <a href="https://alexisbcook.github.io/2017/global-average-pooling-layers-for-object-localization/" rel="nofollow noreferrer">Global Average Pooling</a>, which is an extreme way of pooling where a tensor of dimensions <code>d x h x w</code> is reduced to <code>d x 1 x 1</code>. </p>
What input shapes are required for a classifier that is using a pre-trained network (Pytorch)?
<p>I'm fairly new to deeplearning, python, and pytorch so please bear with me!</p>

<p>I'm trying to understand Transfer Learning in Pytorch using two different Pretrained Networks: Vgg11 and Densenet121.
I've run data of shape (3 x 224 x 224) through the "features" part of the above networks, and the output shapes are as follows:</p>

<p>Vgg11 features output shape: 512 x 7 x 7</p>

<p>Densenet121 features output shape: 1024 x 7 x7</p>

<p>Now, I'm trying to make my own Classifier to use instead of the Pre-trained one. Upon checking both pre-trained classifiers, I see the Vgg11 classifier has in the first layer:</p>

<blockquote>
  <p>(0): Linear(in_features=25088, out_features=4096, bias=True)</p>
</blockquote>

<p>While the Densenet121 has in the first layer:</p>

<blockquote>
  <p>(classifier): Linear(in_features=1024, out_features=1000, bias=True))</p>
</blockquote>

<p>The Vgg one makes sense, since if you flatten the output of the "features" part, you get 512 x 7 x 7 = 25,088.</p>

<p>How does the Densenet one have only 1024 dimensions? If you flatten the output of its "features" part, you get 1024 x 7 x 7 = 50,176</p>

<p>Are there steps that I am missing for either of them? Are there ways to check the input and output shapes of each layer and find out exactly what's happening?</p>

<p>Thank you.</p>