When I tried to override  datasets.ImageFolder  for training with two kinds of ground truth labels, I met such errors.

Traceback (most recent call last):
File “train.py”, line 205, in 
main()
File “train.py”, line 105, in main
train(net, optimizer)
File “train.py”, line 112, in train
for i, data in enumerate(train_loader):
File “/home/public/software/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py”, line 363, in next
data = self._next_data()
File “/home/public/software/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py”, line 989, in _next_data
return self._process_data(data)
File “/home/public/software/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py”, line 1014, in _process_data
data.reraise()
File “/home/public/software/anaconda3/lib/python3.8/site-packages/torch/_utils.py”, line 395, in reraise
raise self.exc_type(msg)
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File “/home/public/software/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py”, line 185, in _worker_loop
data = fetcher.fetch(index)
File “/home/public/software/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py”, line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/home/public/software/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py”, line 44, in 
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/home/public/test/Mymodel/datasets.py”, line 69, in getitem
img1, img2, target1, target2 = self.joint_transform(img1, img2, target1, target2)
TypeError: call() takes 4 positional arguments but 5 were given

Does datasets.ImageFolder support such occasion? How could I fix it? Many thanks!