pytorch / pytorch/vision

Inconsistency in inception

Open
#723 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

🐛 Bug

Hi
I was going through the torchvision code to implement c++ API and I noticed an inconsistency.

In line 298 of inception.py stddev of a class of type BasicConv2d is set to 0.01:

self.conv1.stddev = 0.01

But in line 60 it checks if it's conv2d or linear which a BasicConv2d is none:

if isinstance(m, nn.Conv2d) or isinstance(m, nn.Linear):
   import scipy.stats as stats
   stddev = m.stddev if hasattr(m, 'stddev') else 0.1

I put this code inside the previous if statement:

if hasattr(m, 'stddev'):
    print(m)

and it only printed:

Linear(in_features=768, out_features=1000, bias=True)

so convs inside conv1 BasicConv2d of InceptionAux get initialized with stddev=0.1

is this an error or is it intentional?

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

Read inception.py around lines 60 and 298, then trace how BasicConv2d and InceptionAux are initialized. Verify whether the differing stddev behavior is intentional and identify the affected convolution path. Done means the behavior is confirmed or corrected consistently, with the result verified against the initialization logic.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.