Solved by user_123454321 in post #2 
              
              
                Can you try by setting the target_transform attribute as in 
train_ds = Cityscapes(DATA_DIR,
                      split='train',
                      mode='fine',
                      target_type='semantic',
                      transform=transforms.ToTensor(),
                      target_trans…