pytorch-YOLO-v1 icon indicating copy to clipboard operation
pytorch-YOLO-v1 copied to clipboard

About BatchNormalization

Open Kevinz-code opened this issue 3 years ago • 1 comments

Hi, Thank you for your reproducible code about Yolov1.

I was wondering about the structure of your resnet_yolo.py

def forward(self, x):
    x = self.conv1(x)
    x = self.bn1(x)
    x = self.relu(x)
    x = self.maxpool(x)

    x = self.layer1(x)
    x = self.layer2(x)
    x = self.layer3(x)
    x = self.layer4(x)
    x = self.layer5(x)
    # x = self.avgpool(x)
    # x = x.view(x.size(0), -1)
    # x = self.fc(x)
    x = self.conv_end(x)
    x = self.bn_end(x)
    x = F.sigmoid(x) #归一化到0-1
    # x = x.view(-1,7,7,30)
    x = x.permute(0,2,3,1) #(-1,7,7,30)

Why there is a 'self.bn_end(x)' at the last of the Network? Is it for faster convergency and critical for the performance?

Kevinz-code avatar Mar 10 '21 12:03 Kevinz-code

Because in yolov1, it doesn't have bn layer, but dropout layer. In yolov1, it starts to use bn

ingra14m avatar Apr 18 '22 06:04 ingra14m