Skip to content

Commit

Permalink
removed loading the pretrained parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Benteng Ma committed Mar 11, 2024
1 parent 8db1cb3 commit 5765e66
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class UNetWithResnetEncoder(nn.Module):
def __init__(self, num_classes, in_channels=3, freeze_bn=False, sigmoid=True):
super(UNetWithResnetEncoder, self).__init__()
self.sigmoid = sigmoid
self.resnet = models.resnet34(pretrained=True) # Initialize with a ResNet model
self.resnet = models.resnet34(pretrained=False) # Initialize with a ResNet model
if in_channels != 3:
self.resnet.conv1 = nn.Conv2d(in_channels, 64, kernel_size=7, stride=2, padding=3, bias=False)

Expand Down Expand Up @@ -99,7 +99,7 @@ def unfreeze_bn(self):
class MultiLabelResNet(nn.Module):
def __init__(self, num_labels, input_channels=3, sigmoid=True, pretrained=False,):
super(MultiLabelResNet, self).__init__()
self.model = models.resnet34(pretrained=pretrained)
self.model = models.resnet34(pretrained=False)
self.sigmoid = sigmoid

if input_channels != 3:
Expand Down

0 comments on commit 5765e66

Please sign in to comment.