Hi,
I am creating a model for image classification but getting this error:
Given groups=1, weight of size [40, 3, 3, 3], expected input[16, 32, 33, 5] to have 3 channels, but got 32 channels instead
I am using an efficientnet_b3 model.
Here is my dataset class:
class HolidayDataset(Dataset):
    def __init__(self, train_path, df, transform=None):
        self.train_path = train_path
        self.df = df
        self.transform = transform
        
    def __len__(self):
        return len(self.df)
    
    def __getitem__(self, idx):
        img_name = str(self.df.Image[idx])
        target = str(self.df.Class[idx])
        img_path = self.train_path + img_name
        img = Image.open(img_path)
        img = np.array(img)
        if target == "Miscellaneous":
            target = 0
        elif target == "Christmas_Tree":
            target = 1
        elif target == "Jacket":
            target = 2
        elif target == "Candle":
            target = 3
        elif target == "Airplane":
            target = 4
        elif target == "Snowman":
            target = 5
        if self.transform:
            img = self.transform(image=img)["image"]
        return {
            "img": torch.tensor(img, dtype=torch.float),
            "target": torch.tensor(target, dtype=torch.float)
        }