def _freeze_stages(self):
    if (self.frozen_stages >= 0):
        for param in self.conv1.parameters():
            param.requires_grad = False
    for i in range(1, (self.frozen_stages + 1)):
        layer = getattr(self, f'layer{i}')
        layer.eval()
        for param in layer.parameters():
            param.requires_grad = False
def _freeze_stages(self):
    if (self.frozen_stages >= 0):
        for param in self.conv1.parameters():
            param.requires_grad = False
    for i in range(1, (self.frozen_stages + 1)):
        layer = getattr(self, f'layer{i}')
        layer.eval()
        for param in layer.parameters():
            param.requires_grad = False