Oh I know how it works!
I convert each label to an int array of class indices.
def __getitem__(self, index):
       img_name,label = self.df[index]
       img_path = os.path.join(self.data_dir, img_name+self.img_ext)
       image = cv2.imread(img_path)
       label = list(map(int, label.split(' '))) #'1 40 56 813' --> [1, 40, 56, 813]
       target = torch.zeros(nb_classes)
       target[label] = 1.
       if self.transform is not None:
           image = self.transform(image)
       return image, target

Thanks!