Solved by Suzaku_Kururugi in post #7 
              
              
                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(' ')…