Given groups=1, weight of size 64 1 7 7, expected input[64, 3, 160, 160] to have 1 channels, but got 3 channels instead

I am getting the above error even whilst giving 3 input channels.
This is my architecture code.
class Dnet_1ch(nn.Module):
def __init__(self, arch=arch, n=nunique, pre=True, ps=0.5):
    super().__init__()
    m = arch(True) if pre else arch()
    
    conv = nn.Conv2d(3, 64, kernel_size=5, stride=2, padding=3, bias=False)
    w = (m.features.conv0.weight.sum(1)).unsqueeze(1)
    conv.weight = nn.Parameter(w)
    
    self.layer0 = nn.Sequential(conv, m.features.norm0, nn.ReLU(inplace=True))
    self.layer1 = nn.Sequential(
        nn.MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False),
        m.features.denseblock1)
    self.layer2 = nn.Sequential(m.features.transition1,m.features.denseblock2)
    self.layer3 = nn.Sequential(m.features.transition2,m.features.denseblock3)
    self.layer4 = nn.Sequential(m.features.transition3,m.features.denseblock4,
                                m.features.norm5)
    
    nc = self.layer4[-1].weight.shape[0]
    self.head1 = Head(nc,n)
    #to_Mish(self.layer0), to_Mish(self.layer1), to_Mish(self.layer2)
    #to_Mish(self.layer3), to_Mish(self.layer4)
    
def forward(self, x):    
    x = self.layer0(x)
    x = self.layer1(x)
    x = self.layer2(x)
    x = self.layer3(x)
    x = self.layer4(x)
    
    x1 = self.head1(x)
    
    return x1

Can you figure out what the problem is?