Vision: I find some error in googlenet.py ?

Created on 13 May 2019  路  4Comments  路  Source: pytorch/vision

the kernel size should be 5 in branch3,but there is 3
self.branch3 = nn.Sequential( BasicConv2d(in_channels, ch5x5red, kernel_size=1), BasicConv2d(ch5x5red, ch5x5, kernel_size=3, padding=1) )
Why?

help wanted models

All 4 comments

The model was ported from tensorflow. For some reason they used 3x3 instead of the 5x5.

Maybe a bug in the tensorflow model? I think it should be 5x5. Maybe it's missing a second 3x3 convolutional layer? That would also result in an overall 5x5 convolution. I noticed that batch normalization is used, so based on e.g. this post, the model here seems to be inception-v2 instead of the original GoogLeNet (inception-v1). In a way, a second 3x3 convolutional layer would then make more sense than just setting the kernel size to 5x5.

It鈥檚 most likely a bug, but it鈥檚 something that can鈥檛 easily be changed without retraining the model. If someone can change the 3x3 convolution to 5x5 and retrains the PyTorch model and gets the same or even a better accuracy that would be great, but that鈥檚 most likely not going to happen.

The Inception v2 model or also referred to as BN-Inception has more changes than just replacing one 5x5 with 2 consecutive 3x3 branches and adding batch normalization. So this is still the GoogLeNet model just with added batch normalization, which wasn鈥檛 available at the time of that paper so it was probably to speed up training.
Despite having to retrain the model when adding another 3x3 convolution, this also adds a computational cost of about 30% which is not desired for the GoogLeNet. I hope that clears some things up :)

@TheCodez can you send a PR adding a comment for this discrepancy?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

varunagrawal picture varunagrawal  路  45Comments

zsef123 picture zsef123  路  23Comments

Finniu picture Finniu  路  24Comments

davidsteinar picture davidsteinar  路  23Comments

h6197627 picture h6197627  路  23Comments