Skip to content

Inconsistency in inception #723

Open
@ShahriarRezghi

Description

@ShahriarRezghi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions