ML0401:

elif self.mode == 'test':
            img = Image.open(dir_test + image_name)
            img = self.transforms(img)
            
            return img



If you see this part of the code, you are only returning one element but in the for loop you are expecting 2 elements and hence the error.