pytorch / pytorch/vision

GoogleNet and Inception return different types depending on train / eval mode

Open
#1,273 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module: models needs discussion topic: classification topic: feature extraction
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

Googlenet and Inception have two different return types, depending on train / eval mode.

This is necessary only during training, because the original models have auxiliary classifiers, which are not used for inference.

The current structure of the models might be seen as an artifact on how they were trained.
One other way of seeing it would be that, if we could return arbitrary intermediate outputs, then during training we could plug the auxiliary classifiers outside of the model, and perform training there, but the model by itself doesn't have those auxiliary classifiers.

We should consider if we would be willing to change this, which would be a BC-breaking change.

Advantages:

  • simplifies torchscript support for those models
  • unifies the return value of the model during training and testing

Disadvantages:

  • BC-breaking
  • training those models would require custom code to add the auxiliary heads. But this is not a real disadvantage because we haven't reproduced those models with the current training code anyway.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the GoogLeNet and Inception model implementations and their current training and evaluation return paths. Determine whether a unified return value can support TorchScript and auxiliary classifiers without preserving the existing behavior, then document the compatibility decision and affected training code before proposing a change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.