Input to pre-trained Inception V3

Entropy: <p>I am trying to implement a paper that uses the activations of an Inception v3 model with the final softmax removed (so just the logits). If I understand correctly, that is exactly what the inception_v3 model from torchvision returns? So should I be calling inception_v3 with pretrained=True, input_transforms=True and aux_logits=False? I don’t know what the last parameter does (I think it means auxiliary logits?) but I doubt I need that for my task since my goal is to get that 1000 length tensor with logit outputs for each of the 1000 ImageNet classes.</p>
<p>Also, with input_transforms=True, what kind of input will that model expect? I know that there is some sort of <a href="https://github.com/pytorch/vision/blob/df628c490718044a04cc6481604b47ae69b74cb2/torchvision/models/inception.py#L95-L101" rel="noopener nofollow ugc">inherent normalization that goes on inside the model itself</a>. Given this, what range of values should my input be in so that the model functions properly?</p>
<p>I apologize for the wall of questions. This is my first time working with pre-trained models.</p>

ptrblck: <aside class="quote no-group" data-username="Entropy" data-post="1" data-topic="140892">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/e/5f9b8f/48.png" class="avatar"> Entropy:</div>
<blockquote>
<p>(so just the logits). If I understand correctly, that is exactly what the inception_v3 model from torchvision returns?</p>
</blockquote>
</aside>
<p>Yes, the torchvision implementation returns the logits from the last layer as well as the aux. logits, if specified as seen <a href="https://github.com/pytorch/vision/blob/68f511eb3510ab6fffd258c8aaeffdc1a574212c/torchvision/models/inception.py#L153-L155">here</a>.</p>
<aside class="quote no-group" data-username="Entropy" data-post="1" data-topic="140892">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/e/5f9b8f/48.png" class="avatar"> Entropy:</div>
<blockquote>
<p>I don’t know what the last parameter does (I think it means auxiliary logits?) but I doubt I need that for my task since my goal is to get that 1000 length tensor with logit outputs for each of the 1000 ImageNet classes.</p>
</blockquote>
</aside>
<p>Yes, that’s right and based on your description you could set it to <code>False</code>.</p>
<aside class="quote no-group" data-username="Entropy" data-post="1" data-topic="140892">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/e/5f9b8f/48.png" class="avatar"> Entropy:</div>
<blockquote>
<p>Also, with input_transforms=True, what kind of input will that model expect?</p>
</blockquote>
</aside>
<p><code>transform_input=True</code> will apply <a href="https://github.com/pytorch/vision/blob/68f511eb3510ab6fffd258c8aaeffdc1a574212c/torchvision/models/inception.py#L95-L101">this transformation</a>, which was introduced to match the Inception/Google implementation.</p>