Error occured while training on multilabel classification problem

File “C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py”, line 479, in call
result = self.forward(*input, **kwargs)
TypeError: forward() takes 2 positional arguments but 33 were given

Please help me resolve this problem.

Could you post your training code so that we can have a look at it?
If that’s not possible, could you create a dummy reproducible example throwing the same error message?
Based on the error, it seems you are somehow unpacking the data while passing it to the model.

def train_net(train, val, model, name):
transformations_train = transforms.apply_chain([
transforms.to_float,
transforms.augment_color(0.5),
transforms.random_fliplr(),
transforms.random_flipud(),
transforms.augment(),
torchvision.transforms.ToTensor()
])

transformations_val = transforms.apply_chain([
    transforms.to_float,
    torchvision.transforms.ToTensor()
])

dset_train = HumanProtienJPGDataset(train, paths.train_jpg, transformations_train, divide=False)
train_loader = DataLoader(dset_train,
                          batch_size=2,
                          shuffle=True,
                          #num_workers=10,
                          pin_memory=True)

dset_val = HumanProtienJPGDataset(val, paths.train_jpg, transformations_val, divide=False)
val_loader = DataLoader(dset_val,
                        batch_size=32,
                        #num_workers=10,
                        pin_memory=True)

If i reduce the batch size to 1 i get the following error

RuntimeError: Expected 4-dimensional input for 4-dimensional weight [64, 3, 7, 7], but got 3-dimensional input of size [3, 512, 512] instead

To fix your new error message, it seems you would need to add the batch dimension to your input, as currently you are passing it as [C, H, W].
Try something like data = data.unsqueeze(0) before passing it to the model.

The code you’ve posted does not show the code snippet where you pass the input to your model, so it’s still unclear to me, how that many arguments are being passed.