Hi,
Can you check
  
    
    
    RuntimeError: Given weight of size 3 1 5 5, expected bias to be 1-dimensional with 3 elements, but got bias of size [6] instead 
  
  
    Your model seems to work fine with bias=False and bias=True: 
class LeNet(nn.Module):
    def __init__(self):
        super(LeNet, self).__init__()
        self.conv1 = nn.Conv2d(1, 6, 5,bias=False)
        self.conv2 = nn.Conv2d(6, 16, 5)
        self.fc1 = nn.Linear(16 * 5 * 5, 120)
        self.fc2 = nn.Linear(120, 84)
        self.fc3 = nn.Linear(84, 10)
    
    def forward(self, x):
        out = self.conv1(x)
        out = F.relu(out)
        out = F.max_pool2d(out, 2)
        out = F.rel…
  



  
    
    
    RuntimeError: Given groups=1, weight[64, 3, 3, 3], so expected input[16, 64, 256, 256] to have 3 channels, but got 64 channels instead vision
  
  
    Your input contains 4 channels, while the first conv layer expects an input with 3 channels. 
If you are dealing with RGB images, the 4th channel might be the alpha channel, which could just be removed. 
If you are using a custom DataLoader, you could probably just use: 
def __getitem__(self, index):
    img = Image.open(self.paths[index]).convert('RGB')
    ...
    # Alternatively remove the alpha channel from the tensor
    img = Image.open(self.paths[index])
    x = TF.to_tensor(img)
    x = …
  


if the above doesn’t work
can you check the links below
https://www.google.com/search?q=RuntimeError%3A+Given+weight+of+size+[1%2C+3%2C+8%2C+12]%2C+expected+bias+to+be+1-dimensional+with+1+elements%2C+but+got+bias+of+size+[8]+instead&oq=RuntimeError%3A+Given+weight+of+size+[1%2C+3%2C+8%2C+12]%2C+expected+bias+to+be+1-dimensional+with+1+elements%2C+but+got+bias+of+size+[8]+instead&aqs=chrome..69i57j69i58&sourceid=chrome&ie=UTF-8 1
With best regards,
Programmer-RD-AI