Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in inception #723

Open
ShahriarRezghi opened this issue Jan 23, 2019 · 1 comment
Open

Inconsistency in inception #723

ShahriarRezghi opened this issue Jan 23, 2019 · 1 comment
Labels

Comments

@ShahriarRezghi
Copy link
Contributor

🐛 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?

@fmassa
Copy link
Member

fmassa commented Feb 11, 2019

Hi,

Sorry for the delay in replying.

I believe this is an error.

Also, the way of initializing the weights in inception is pretty weird, and I believe it would be better to initialize everything in the corresponding modules.

@fmassa fmassa added the bug label Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants