class TrainLoader(Dataset):
 
   def __init__(self,im_dir,ann_dir,img_idx,transform=None):
      self.im_dir=im_dir
      self.ann_dir=ann_dir
      self.img_idx=img_idx
      self.transform=transform
    
  def __len__(self):
     return len(self.img_idx)

  def __getitem__(self,idx):
      print('read')
      image=plt.imread(glob.glob(self.im_dir+ '*_%08d.jpg'%int(self.img_idx[idx]))[0])
      image=(image-np.mean(image))/np.std(image)
      lb=plt.imread(glob.glob(self.ann_dir+ '*_%08d.png'%int(self.img_idx[idx]))[0])*255
      image=self.transform(image)
      lb=torch.from_numpy(lb)
      print(self.img_idx[idx])
  
      return image,lb
    
 transform=transforms.Compose([transforms.ToTensor()])
 t_images,t_label=TrainLoader(im_dir=train_im_dir,ann_dir=train_ann_dir,img_idx=t_lb,transform=transform)


read
00017104
read
00016549
read
00002785
ValueError                                Traceback (most recent call last)
 in ()
1 transform=transforms.Compose([transforms.ToTensor()])
----> 2 t_images,t_label=TrainLoader(im_dir=train_im_dir,ann_dir=train_ann_dir,img_idx=t_lb,transform=transform)
3
4
ValueError: too many values to unpack (expected 2)
I’m working on ADE20k dataset ,Can someone help me with this?