Training segmentation error : __call__() missing 1 required positional argument: 'target'

Hi, I try to train a FCN-Resnet50 with cityscapes gtFine datasets but i encounter this error and i don’t know any way to solve it, do you have idea to solve it ?

python3 --aux-loss --data-path=/home/manip/vision/references/segmentation/cityscapes -b 240
Not using distributed mode
Namespace(amp=False, aux_loss=True, batch_size=240, data_path=’/home/manip/vision/references/segmentation/cityscapes’, dataset=‘cityscapes’, device=‘cuda’, dist_url=‘env://’, distributed=False, epochs=30, lr=0.01, lr_warmup_decay=0.01, lr_warmup_epochs=0, lr_warmup_method=‘linear’, model=‘fcn_resnet50’, momentum=0.9, output_dir=’.’, print_freq=10, resume=’’, start_epoch=0, test_only=False, use_deterministic_algorithms=False, weight_decay=0.0001, weights=None, weights_backbone=None, workers=0, world_size=1)
Traceback (most recent call last):
File “”, line 313, in
File “”, line 233, in main
train_one_epoch(model, criterion, optimizer, data_loader, lr_scheduler, device, epoch, args.print_freq, scaler)
File “”, line 102, in train_one_epoch
for image, target in metric_logger.log_every(data_loader, print_freq, header):
File “/home/manip/vision/references/segmentation/”, line 164, in log_every
for obj in iterable:
File “/home/manip/.local/lib/python3.8/site-packages/torch/utils/data/”, line 530, in next
data = self._next_data()
File “/home/manip/.local/lib/python3.8/site-packages/torch/utils/data/”, line 570, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File “/home/manip/.local/lib/python3.8/site-packages/torch/utils/data/_utils/”, line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/home/manip/.local/lib/python3.8/site-packages/torch/utils/data/_utils/”, line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/home/manip/.local/lib/python3.8/site-packages/torchvision/datasets/”, line 197, in getitem
image, target = self.transforms(image, target)
File “/home/manip/.local/lib/python3.8/site-packages/torchvision/datasets/”, line 95, in call
input = self.transform(input)
TypeError: call() missing 1 required positional argument: ‘target’

Based on the stacktrace the code fails here so check your used transformations. I guess you might have passed to wrong transformations to StandardTransform via transform and target_transform as the former seems to expect two inputs in your script.