@ptrblck Thanks for helping me. you want to say like this?But still same error…
        img_name_BW = os.path.join(self.root_dir,
                                self.img_names.iloc[idx, 0])
        image_BW = Image.open(img_name_BW+'.bmp')
        torchvision.transforms.functional.to_tensor(image_BW)
        img_name_RGB = os.path.join(self.root_dir,
                                self.img_names.iloc[idx, 1])
        image_RGB = Image.open(img_name_RGB+'.bmp')
        torchvision.transforms.functional.to_tensor(image_RGB)
        image= torch.cat((image_BW, image_RGB), 1)