If anyone is looking for a way to extract the features of inception_v3 layer by layer:
from torchvision.models.inception import Inception3
from torchvision.models.utils import load_state_dict_from_url
import torch.nn.functional as F


model_urls = {
    # Inception v3 ported from TensorFlow
    'inception_v3_google': 'https://download.pytorch.org/models/inception_v3_google-1a9a5a14.pth',
}
def inception_v3_sliced(pretrained=False, progress=True, stop_layer=3, **kwargs):
    r"""Inception v3 model architecture from
    `"Rethinking the Inception Architecture for Computer Vision" <http://arxiv.org/abs/1512.00567>`_.
    .. note::
        **Important**: In contrast to the other models the inception_v3 expects tensors with a size of
        N x 3 x 299 x 299, so ensure your images are sized accordingly.
    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
        progress (bool): If True, displays a progress bar of the download to stderr
        aux_logits (bool): If True, add an auxiliary branch that can improve training.
            Default: *True*
        transform_input (bool): If True, preprocesses the input according to the method with which it
            was trained on ImageNet. Default: *False*
    """
    if pretrained:
        if 'transform_input' not in kwargs:
            kwargs['transform_input'] = True
        if 'aux_logits' in kwargs:
            original_aux_logits = kwargs['aux_logits']
            kwargs['aux_logits'] = True
        else:
            original_aux_logits = True
        kwargs['init_weights'] = False  # we are loading weights from a pretrained model
        class Inception3Mod(Inception3):
          def __init__(self, stop_layer, **kwargs):
            super(Inception3Mod, self).__init__(**kwargs)
            self.stop_layer = stop_layer
          def _forward(self, x):
            layers = [
             self.Conv2d_1a_3x3,
             self.Conv2d_2a_3x3,
             self.Conv2d_2b_3x3,
             'maxpool',
             self.Conv2d_3b_1x1,
             self.Conv2d_4a_3x3,
             'maxpool',
             self.Mixed_5b,
             self.Mixed_5c,
             self.Mixed_5d,
             self.Mixed_6a,
             self.Mixed_6b,
             self.Mixed_6c,
             self.Mixed_6d,
             self.Mixed_6e,
             self.Mixed_7a,
             self.Mixed_7b,
             self.Mixed_7c,
            ]

            for idx in range(self.stop_layer):
              layer = layers[idx]
              if layer == 'maxpool':
                x = F.max_pool2d(x, kernel_size=3, stride=2)
              else:
                x = layer(x)
            return x, None


        model = Inception3Mod(**kwargs, stop_layer=stop_layer)
        state_dict = load_state_dict_from_url(model_urls['inception_v3_google'],
                                              progress=progress)
        model.load_state_dict(state_dict)
        if not original_aux_logits:
            model.aux_logits = False
            del model.AuxLogits
        return model

    return Inception3Mod(**kwargs)

then call
model = inception_v3_sliced(pretrained=True, stop_layer=12)